-
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.
- Loading branch information
1 parent
fe802fc
commit 079cd6a
Showing
2 changed files
with
52 additions
and
2 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
e2e/test/scenarios/question/reproductions/39699-notebook-data-source-models.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,50 @@ | ||
import { SAMPLE_DATABASE } from "e2e/support/cypress_sample_database"; | ||
import { SECOND_COLLECTION_ID } from "e2e/support/cypress_sample_instance_data"; | ||
import { restore, openNotebook } from "e2e/support/helpers"; | ||
|
||
const { REVIEWS_ID } = SAMPLE_DATABASE; | ||
|
||
const modelDetails = { | ||
name: "GUI Model", | ||
query: { "source-table": REVIEWS_ID, limit: 1 }, | ||
display: "table", | ||
type: "model", | ||
collection_id: SECOND_COLLECTION_ID, | ||
}; | ||
|
||
describe("issue 39699", () => { | ||
beforeEach(() => { | ||
restore(); | ||
cy.signInAsAdmin(); | ||
|
||
cy.createQuestion(modelDetails, { visitQuestion: true }); | ||
}); | ||
|
||
it("data selector should properly show a model as the source (metabase#39699)", () => { | ||
openNotebook(); | ||
cy.findByTestId("data-step-cell") | ||
.should("have.text", modelDetails.name) | ||
.click(); | ||
|
||
cy.findByTestId("saved-entity-back-navigation").should( | ||
"have.text", | ||
"Models", | ||
); | ||
|
||
cy.findByTestId("saved-entity-collection-tree").within(() => { | ||
cy.findByLabelText("Our analytics") | ||
.should("have.attr", "aria-expanded", "false") | ||
.and("have.attr", "aria-selected", "false"); | ||
cy.findByLabelText("First collection") | ||
.should("have.attr", "aria-expanded", "true") | ||
.and("have.attr", "aria-selected", "false"); | ||
cy.findByLabelText("Second collection") | ||
.should("have.attr", "aria-expanded", "false") | ||
.and("have.attr", "aria-selected", "true"); | ||
}); | ||
|
||
cy.findByTestId("select-list") | ||
.findByLabelText(modelDetails.name) | ||
.should("have.attr", "aria-selected", "true"); | ||
}); | ||
}); |
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