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

content info drawer to view classifications and more #2491

Merged
merged 12 commits into from
Dec 21, 2024
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
describe("Create Folders Tests", function () {
describe("Activity Editor Tests", function () {
it("correctly restore editor state after clicking view", () => {
// test bug where activity editor was not restoring itself with the correct state
// after one switched to view mode and back

cy.loginAsTestUser();

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

cy.iframe()
Expand Down
60 changes: 60 additions & 0 deletions client/cypress/e2e/Activities/activityViewer.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
describe("Activity Viewer Tests", function () {
it("classifications shown in activity viewer", () => {
cy.loginAsTestUser();
cy.createActivity({
activityName: "Classifications!",
doenetML: "Hi!",
classifications: [
{
systemShortName: "WeBWorK",
category: "Algebra",
subCategory: "Factoring",
code: "Alg.F.2",
},
{
systemShortName: "Common Core",
category: "HS",
subCategory:
"Seeing Structure in Expressions. Write expressions in equivalent forms to solve problems.",
code: "A.SSE.3 a.",
},
],
}).then((activityId) => {
cy.visit(`/activityViewer/${activityId}`);

cy.get('[data-test="Classifications Footer"]').should(
"contain.text",
"Alg.F.2",
);
cy.get('[data-test="Classifications Footer"]').should(
"contain.text",
"A.SSE.3 a.",
);
cy.get('[data-test="Classifications Footer"]').click();

cy.get('[data-test="Classification 1"]').should(
"contain.text",
"A.SSE.3 a.",
);
cy.get('[data-test="Classification 2"]').should(
"contain.text",
"Alg.F.2",
);

cy.get('[data-test="Close Settings Button"]').click();
cy.get('[data-test="Classification 1"]').should("not.exist");

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

cy.get('[data-test="Classifications"]').click();
cy.get('[data-test="Classification 1"]').should(
"contain.text",
"A.SSE.3 a.",
);
cy.get('[data-test="Classification 2"]').should(
"contain.text",
"Alg.F.2",
);
});
});
});
38 changes: 38 additions & 0 deletions client/cypress/e2e/Activities/codeViewer.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
describe("Code Viewer Tests", function () {
it("classifications shown in code viewer", () => {
cy.loginAsTestUser();
cy.createActivity({
activityName: "Classifications!",
doenetML: "Hi!",
classifications: [
{
systemShortName: "WeBWorK",
category: "Algebra",
subCategory: "Factoring",
code: "Alg.F.2",
},
{
systemShortName: "Common Core",
category: "HS",
subCategory:
"Seeing Structure in Expressions. Write expressions in equivalent forms to solve problems.",
code: "A.SSE.3 a.",
},
],
}).then((activityId) => {
cy.visit(`/codeViewer/${activityId}`);

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

cy.get('[data-test="Classifications"]').click();
cy.get('[data-test="Classification 1"]').should(
"contain.text",
"A.SSE.3 a.",
);
cy.get('[data-test="Classification 2"]').should(
"contain.text",
"Alg.F.2",
);
});
});
});
4 changes: 2 additions & 2 deletions client/cypress/e2e/Activities/sharingActivities.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ describe("Share Activities Tests", function () {
cy.get('[data-test="Sharing Button"]').click();
cy.get('[data-test="Public Checkbox"]').click();
cy.get('[data-test="Status message"]').should(
"have.text",
"Successfully shared publicly",
"contain.text",
"shared publicly",
);

cy.get('[data-test="Close Share Drawer Button"]').click();
Expand Down
50 changes: 50 additions & 0 deletions client/cypress/e2e/Search/searchResult.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
describe("Search results Tests", function () {
it("classifications shown in search", () => {
cy.loginAsTestUser();
let code = Date.now().toString();

cy.createActivity({
activityName: `Classifications${code}!`,
doenetML: "Hi!",
makePublic: true,
classifications: [
{
systemShortName: "WeBWorK",
category: "Algebra",
subCategory: "Factoring",
code: "Alg.F.2",
},
{
systemShortName: "Common Core",
category: "HS",
subCategory:
"Seeing Structure in Expressions. Write expressions in equivalent forms to solve problems.",
code: "A.SSE.3 a.",
},
],
}).then((activityId) => {
cy.visit(`/community?q=Classifications${code}`);

cy.get('[data-test="Results All Matches"] [data-test="Card Menu Button"]')
.eq(0)
.click();

cy.get(
'[data-test="Results All Matches"] [data-test="Activity Information"]',
)
.eq(0)
.click();

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

cy.get('[data-test="Classification 1"]').should(
"contain.text",
"A.SSE.3 a.",
);
cy.get('[data-test="Classification 2"]').should(
"contain.text",
"Alg.F.2",
);
});
});
});
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
describe("Classifications test", function () {
describe("Classification panel tests", function () {
it("add classifications to activity", () => {
cy.loginAsTestUser();

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

cy.get('[data-test="Settings Button"]').click();
Expand Down Expand Up @@ -87,7 +90,7 @@ describe("Classifications test", function () {

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");
cy.get('[data-test="Add 9.2.3.3"]').scrollIntoView().should("be.visible");
});
});
});
Loading
Loading