-
Notifications
You must be signed in to change notification settings - Fork 35
fix: preserve condition values when updating user settings #2203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
797aa56
70f419e
1154640
69147b6
76f2a4e
81dbb71
3d4e969
de40cb4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -669,4 +669,57 @@ describe("Datasets general", () => { | |
| .should("be.visible"); | ||
| }); | ||
| }); | ||
|
|
||
| describe("Condition value persistence after navigation", () => { | ||
| beforeEach(() => { | ||
| cy.login(Cypress.env("username"), Cypress.env("password")); | ||
| cy.createDataset({ | ||
| type: "raw", | ||
| dataFileSize: "small", | ||
| scientificMetadata: { | ||
| run_number: { type: "number", value: 76129, unit: "" }, | ||
| }, | ||
| }); | ||
| cy.visit("/datasets"); | ||
| }); | ||
|
|
||
| it("should persist condition values after navigating away and back", () => { | ||
| cy.get('[data-cy="scientific-condition-filter-list"]').within(() => { | ||
| cy.get('[data-cy="add-condition-button"]').click(); | ||
| }); | ||
|
|
||
| cy.get('input[name="lhs"]').type("run_number"); | ||
|
|
||
| cy.get("mat-dialog-container").find('button[type="submit"]').click(); | ||
|
|
||
| cy.get(".condition-panel").first().click(); | ||
|
|
||
| cy.get(".condition-panel") | ||
| .first() | ||
| .within(() => { | ||
| cy.get("mat-select").click(); | ||
| }); | ||
| cy.get("mat-option").contains(">").click(); | ||
|
|
||
| cy.get(".condition-panel") | ||
| .first() | ||
| .within(() => { | ||
| cy.get("input[matInput]").eq(0).clear().type("19"); | ||
| }); | ||
|
|
||
| cy.get('[data-cy="filter-search-button"]').click(); | ||
|
|
||
| cy.get(".dataset-table mat-row").first().click(); | ||
|
|
||
| cy.get('[data-cy="edit-general-information"]').should("exist"); | ||
|
|
||
| cy.go('back'); | ||
|
|
||
| cy.get(".condition-panel") | ||
| .first() | ||
| .find("mat-panel-title") | ||
| .should("contain", ">") | ||
| .and("contain", "19"); | ||
|
Comment on lines
+716
to
+722
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion (testing): Selectors in the new test are fairly generic and may be brittle over time. The assertions after Suggested implementation: cy.go('back');
cy.get('[data-cy="condition-panel"]')
.first()
.within(() => {
cy.get('[data-cy="condition-operator"]').should("contain", ">");
cy.get('[data-cy="condition-value"]').should("contain", "19");
});To make this test pass and keep it robust, you’ll need to:
|
||
| }); | ||
| }) | ||
| }); | ||
Uh oh!
There was an error while loading. Please reload this page.