Skip to content

Commit

Permalink
test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Shiel committed Sep 23, 2023
1 parent e8848ff commit 41bdb16
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 18 deletions.
2 changes: 1 addition & 1 deletion client/src/components/setup/welcome-slide.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function WelcomeSlide(props: {
</Typography>
<Typography variant="h6" className={classes.text}>
{mentorConfig?.welcomeSlideText ||
"Let&apos;s get started setting up your new mentor."}
"Let's get started setting up your new mentor."}
</Typography>
<Typography
data-cy="walkthrough-intro"
Expand Down
1 change: 0 additions & 1 deletion client/src/pages/record.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ function RecordPage(props: {
const { width: windowWidth, height: windowHeight } = useWithWindowSize();

const { browserSupportsVbg } = useWithBrowser();

const mentorId = getData((state) => state.data?._id);
const mentorType = getData((state) => state.data?.mentorType);
const mentorConfig: MentorConfig | undefined = getData(
Expand Down
54 changes: 38 additions & 16 deletions cypress/cypress/integration/answer-versioning.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,22 @@ describe("answer versioning", () => {
},
},
]),
mockGQL("Answer", {
answer: {
...videoMentor.answers[1],
...uploadTaskMediaBuild(),
transcript: "i am aaron",
previousVersions: [
{
transcript: "I'm 37 years old",
webVideoHash: "",
vttText: "",
videoDuration: "",
dateVersioned: "",
},
],
},
}),
],
});
cy.visit("/record?videoId=A2_1_1");
Expand All @@ -375,17 +391,6 @@ describe("answer versioning", () => {
"I'm 37 years old"
);
});

cy.get("[data-cy=versions-dialog-pagination]").within(() => {
cy.get("[data-cy=single-right]").click();
});

cy.get("[data-cy=previous-version]").within(() => {
cy.get("[data-cy=transcript]").should(
"have.text",
"previous transcript 1"
);
});
});
});

Expand All @@ -411,6 +416,22 @@ describe("answer versioning", () => {
},
},
]),
mockGQL("Answer", {
answer: {
...videoMentor.answers[1],
...uploadTaskMediaBuild(),
transcript: "i am aaron",
previousVersions: [
{
transcript: "I'm 37 years old",
webVideoHash: "",
vttText: "",
videoDuration: "",
dateVersioned: "",
},
],
},
}),
],
});
cy.visit("/record?videoId=A2_1_1");
Expand All @@ -427,25 +448,26 @@ describe("answer versioning", () => {
.trigger("mousedown", { button: 0 });

cy.get("[data-cy=upload-video]").trigger("mouseover").click();
cy.get("[data-cy=notification-dialog-button]").click();
cy.get("[data-cy=close-error-dialog]").click();

// check that previous version was stored
cy.get("[data-cy=versions-icon]").click();
cy.get("[data-cy=versions-dialog]").should("be.visible");

cy.get("[data-cy=previous-version]").within(() => {
cy.get("[data-cy=transcript]").should("have.text", "i am aaron");
cy.get("[data-cy=transcript]").should(
"have.text",
"I'm 37 years old"
);
});

cy.get("[data-cy=versions-dialog-pagination]").within(() => {
cy.get("[data-cy=single-right]").click();
});

cy.get("[data-cy=previous-version]").within(() => {
cy.get("[data-cy=transcript]").should(
"have.text",
"I'm 37 years old"
);
cy.get("[data-cy=transcript]").should("have.text", "i am aaron");
});
});
});
Expand Down

0 comments on commit 41bdb16

Please sign in to comment.