Skip to content
Snippets Groups Projects
Unverified Commit fb4e8928 authored by Ryan Laurie's avatar Ryan Laurie Committed by GitHub
Browse files

wait for valid actions payload (#32684)

parent b8861b40
No related branches found
No related tags found
No related merge requests found
......@@ -229,7 +229,10 @@ export function waitForSyncToFinish({
if (!body.tables.length) {
waitForSyncToFinish({ iteration: ++iteration, dbId, tableName });
} else if (tableName) {
const hasTable = body.tables.some(table => table.name === tableName);
const hasTable = body.tables.some(
table =>
table.name === tableName && table.initial_sync_status === "complete",
);
if (!hasTable) {
waitForSyncToFinish({ iteration: ++iteration, dbId, tableName });
}
......
......@@ -1033,7 +1033,7 @@ describe(
cy.button("Pick an action").click();
});
cy.wait("@getActions");
waitForValidActions();
cy.findByRole("dialog").within(() => {
cy.findByText(MODEL_NAME).click();
......@@ -1095,7 +1095,7 @@ function createDashboardWithActionButton({
cy.button("Pick an action").click();
});
cy.wait("@getActions");
waitForValidActions();
cy.findByRole("dialog").within(() => {
cy.findByText(modelName).click();
......@@ -1182,3 +1182,13 @@ function actionEditorModal() {
function getActionParametersInputModal() {
return cy.findByTestId("action-parameters-input-modal");
}
function waitForValidActions() {
cy.wait("@getActions").then(({ response }) => {
const { body: actions } = response;
actions.forEach(action => {
expect(action.parameters).to.have.length.gt(0);
});
});
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment