-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix missing result metadata (#39201)
* Keep result-metadata of native queries if possible Part of #37009. * Fix typo * Add a fallback for when resultMetadata is not available * Revert "Add a fallback for when resultMetadata is not available" This reverts commit 5ad3a8b. * Move resultsMetadata logic into getSubmittableQuestion * Add a fallback for when resultMetadata is not available * Add explanatory comment * Guard against missing resultsMetadata * Add repro for #35039 * Simplify the test * Add an explanatory comment * Fix test * Rename promise to runQuestionPromise --------- Co-authored-by: Tamás Benkő <tamas@metabase.com>
- Loading branch information
1 parent
0b51201
commit d26b782
Showing
4 changed files
with
80 additions
and
7 deletions.
There are no files selected for viewing
61 changes: 61 additions & 0 deletions
61
e2e/test/scenarios/models/reproductions/35039-37009-missing-result-metadata.cy.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import { | ||
focusNativeEditor, | ||
modal, | ||
openQuestionActions, | ||
popover, | ||
restore, | ||
} from "e2e/support/helpers"; | ||
|
||
describe("issues 35039 and 37009", () => { | ||
beforeEach(() => { | ||
restore(); | ||
cy.signInAsNormalUser(); | ||
}); | ||
|
||
// This test follows #37009 repro steps because they are simpler than #35039 but still equivalent | ||
it("should show columns available in the model (metabase#35039) (metabase#37009)", () => { | ||
cy.visit("/model/new"); | ||
cy.findByTestId("new-model-options") | ||
.findByText("Use a native query") | ||
.click(); | ||
|
||
focusNativeEditor().type("select * from products -- where true=false"); | ||
|
||
cy.findByTestId("dataset-edit-bar").findByText("Save").click(); | ||
modal() | ||
.last() | ||
.within(() => { | ||
cy.findByLabelText("Name").type("Model").realPress("Tab"); | ||
cy.findByText("Save").click(); | ||
}); | ||
|
||
openQuestionActions(); | ||
popover().findByText("Edit query definition").click(); | ||
|
||
focusNativeEditor().type( | ||
"{backspace}{backspace}{backspace}{backspace}{backspace}", | ||
); | ||
cy.findByTestId("dataset-edit-bar").within(() => { | ||
cy.findByText("Save changes").click(); | ||
cy.findByText("Saving…").should("not.exist"); | ||
}); | ||
|
||
cy.findByTestId("query-builder-main").within(() => { | ||
cy.findByText("Doing science...").should("be.visible"); | ||
cy.findByText("Doing science...").should("not.exist"); | ||
}); | ||
|
||
cy.icon("notebook").click(); | ||
cy.findByTestId("fields-picker").click(); | ||
popover().within(() => { | ||
cy.findByText("ID").should("exist"); | ||
cy.findByText("EAN").should("exist"); | ||
cy.findByText("TITLE").should("exist"); | ||
cy.findByText("CATEGORY").should("exist"); | ||
cy.findByText("VENDOR").should("exist"); | ||
cy.findByText("PRICE").should("exist"); | ||
cy.findByText("RATING").should("exist"); | ||
cy.findByText("CREATED_AT").should("exist"); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters