Skip to content
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

revise add classifications approach #2488

Merged
merged 5 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions client/cypress/e2e/SettingsPanel/classifications.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
describe("Classifications test", function () {
it("add classifications to activity", () => {
cy.loginAsTestUser();

cy.createActivity("Hello!", "Initial content").then((activityId) => {
cy.visit(`/activityEditor/${activityId}`);

cy.get('[data-test="Settings Button"]').click();

cy.get('[data-test="Classifications"]').click();

cy.get('[data-test="Classifications"]').should(
"have.text",
"Classifications (0)",
);

cy.get('[data-test="Search Terms"]').type("factor quadratic{enter}");

cy.get('[data-test="Add 9.2.4.1"]').click();
cy.get('[data-test="Add A.REI.4 b."]').click();

cy.get('[data-test="Classifications"]').should(
"have.text",
"Classifications (2)",
);

cy.get('[data-test="Existing Classification 1"]').should(
"have.text",
"A.REI.4 b.",
);
cy.get('[data-test="Existing Classification 2"]').should(
"have.text",
"9.2.4.1",
);

cy.get('[data-test="Remove A.REI.4 b."]').click();
cy.get('[data-test="Classifications"]').should(
"have.text",
"Classifications (1)",
);
cy.get('[data-test="Existing Classification 1"]').should(
"have.text",
"9.2.4.1",
);

cy.get('[data-test="Filter By System').select("Common Core");
cy.get('[data-test="Add A.REI.4 b."]').should("be.visible");

cy.get('[data-test="Filter By Category').select("Grade 6");
cy.get('[data-test="Add A.REI.4 b."]').should("not.exist");

cy.get('[data-test="Filter By Subcategory').select(2);
cy.get('[data-test="Matching Classifications').should(
"contain.text",
"No matching classifications",
);

cy.get('[data-test="Stop Filter By Subcategory').click();

cy.get('[data-test="Add 6.EE.2 b."]').click();
cy.get('[data-test="Classifications"]').should(
"have.text",
"Classifications (2)",
);
cy.get('[data-test="Existing Classification 1"]').should(
"have.text",
"6.EE.2 b.",
);
cy.get('[data-test="Existing Classification 2"]').should(
"have.text",
"9.2.4.1",
);

cy.get('[data-test="Remove Existing 6.EE.2 b."]').click();
cy.get('[data-test="Classifications"]').should(
"have.text",
"Classifications (1)",
);
cy.get('[data-test="Existing Classification 1"]').should(
"have.text",
"9.2.4.1",
);

cy.get('[data-test="Add A.REI.4 b."]').should("not.exist");
cy.get('[data-test="Stop Filter By Category').click();
cy.get('[data-test="Add A.REI.4 b."]').should("be.visible");

cy.get('[data-test="Add 9.2.3.3"]').should("not.exist");
cy.get('[data-test="Stop Filter By System').click();
cy.get('[data-test="Add 9.2.3.3"]').should("be.visible");
});
});
});
Loading
Loading