Check for new outfit saved indicator in Cypress
This commit is contained in:
parent
99e0fdbf59
commit
8b5ba60ea8
6 changed files with 19 additions and 27 deletions
|
@ -15,10 +15,8 @@ describe("WardrobePage: Outfit saving", () => {
|
||||||
|
|
||||||
// Wait for the outfit to stop saving, and check that it redirected and
|
// Wait for the outfit to stop saving, and check that it redirected and
|
||||||
// still shows the correct outfit preview and name.
|
// still shows the correct outfit preview and name.
|
||||||
cy.location("pathname", { timeout: 12000 }).should(
|
page.getOutfitIsSavedIndicator({ timeout: 12000 }).should("exist");
|
||||||
"match",
|
cy.location("pathname").should("match", /^\/outfits\/[0-9]+$/);
|
||||||
/^\/outfits\/[0-9]+$/
|
|
||||||
);
|
|
||||||
page.getOutfitName().should("have.text", outfitName);
|
page.getOutfitName().should("have.text", outfitName);
|
||||||
page.getOutfitPreview().toMatchImageSnapshot();
|
page.getOutfitPreview().toMatchImageSnapshot();
|
||||||
});
|
});
|
||||||
|
@ -39,10 +37,8 @@ describe("WardrobePage: Outfit saving", () => {
|
||||||
|
|
||||||
// Wait for the outfit to stop saving, and check that it redirected and
|
// Wait for the outfit to stop saving, and check that it redirected and
|
||||||
// still shows the correct outfit preview and name.
|
// still shows the correct outfit preview and name.
|
||||||
cy.location("pathname", { timeout: 12000 }).should(
|
page.getOutfitIsSavedIndicator({ timeout: 12000 }).should("exist");
|
||||||
"match",
|
cy.location("pathname").should("match", /^\/outfits\/[0-9]+$/);
|
||||||
/^\/outfits\/[0-9]+$/
|
|
||||||
);
|
|
||||||
page.getOutfitName().should("have.text", outfitName);
|
page.getOutfitName().should("have.text", outfitName);
|
||||||
page.getOutfitPreview().toMatchImageSnapshot();
|
page.getOutfitPreview().toMatchImageSnapshot();
|
||||||
});
|
});
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 313 KiB After Width: | Height: | Size: 316 KiB |
Binary file not shown.
Before Width: | Height: | Size: 52 KiB |
Binary file not shown.
After Width: | Height: | Size: 50 KiB |
|
@ -1,14 +1,14 @@
|
||||||
export function getSpeciesSelect(options) {
|
const withTestId = (testId) => (options) =>
|
||||||
return cy.get("[data-test-id=wardrobe-species-picker]", options);
|
cy.get(`[data-test-id="${CSS.escape(testId)}"]`, options);
|
||||||
}
|
|
||||||
|
|
||||||
export function getColorSelect(options) {
|
export const getSpeciesSelect = withTestId("wardrobe-species-picker");
|
||||||
return cy.get("[data-test-id=wardrobe-color-picker]", options);
|
export const getColorSelect = withTestId("wardrobe-color-picker");
|
||||||
}
|
export const getPosePickerButton = withTestId("wardrobe-pose-picker");
|
||||||
|
export const getOutfitName = withTestId("outfit-name");
|
||||||
export function getPosePickerButton(options) {
|
export const getSaveOutfitButton = withTestId("wardrobe-save-outfit-button");
|
||||||
return cy.get("[data-test-id=wardrobe-pose-picker]", options);
|
export const getOutfitIsSavedIndicator = withTestId(
|
||||||
}
|
"wardrobe-outfit-is-saved-indicator"
|
||||||
|
);
|
||||||
|
|
||||||
export function getPosePickerOption(label, options) {
|
export function getPosePickerOption(label, options) {
|
||||||
return cy.get(`input[aria-label="${CSS.escape(label)}"]`, options);
|
return cy.get(`input[aria-label="${CSS.escape(label)}"]`, options);
|
||||||
|
@ -20,11 +20,3 @@ export function getOutfitPreview() {
|
||||||
timeout: 15000,
|
timeout: 15000,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getOutfitName(options) {
|
|
||||||
return cy.get("[data-test-id=outfit-name]", options);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getSaveOutfitButton(options) {
|
|
||||||
return cy.get("[data-test-id=wardrobe-save-outfit-button]", options);
|
|
||||||
}
|
|
||||||
|
|
|
@ -429,7 +429,11 @@ function OutfitSavingIndicator({ outfitState }) {
|
||||||
|
|
||||||
if (latestVersionIsSaved) {
|
if (latestVersionIsSaved) {
|
||||||
return (
|
return (
|
||||||
<Flex align="center" fontSize="xs">
|
<Flex
|
||||||
|
align="center"
|
||||||
|
fontSize="xs"
|
||||||
|
data-test-id="wardrobe-outfit-is-saved-indicator"
|
||||||
|
>
|
||||||
<CheckIcon
|
<CheckIcon
|
||||||
marginRight="1"
|
marginRight="1"
|
||||||
// HACK: Not sure why my various centering things always feel wrong...
|
// HACK: Not sure why my various centering things always feel wrong...
|
||||||
|
|
Loading…
Reference in a new issue