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

dev-next-release - 1.19.0 #1178

Merged
merged 37 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
27c976a
feat(slice-machine-ui): update List component (#1174)
bapmrl Oct 19, 2023
0a99222
Publish
bapmrl Oct 19, 2023
e3f3528
fix(custom type): Prevent modal to stay open after adding a slice (#1…
xrutayisire Oct 19, 2023
e5f6172
Publish
xrutayisire Oct 19, 2023
e275ae6
fix(plugin-kit): ignore empty slice folders (DT-1589) (#1180)
lihbr Oct 20, 2023
77956ea
Publish
lihbr Oct 20, 2023
aa5ad18
fix(repository name): Repository name length can be up to 63 and not …
xrutayisire Oct 20, 2023
1899ff1
Publish
xrutayisire Oct 20, 2023
bf45175
feat(deps): upgrade to prettier 3 (#1055,DT-1614) (#1183)
lihbr Oct 20, 2023
97f76e4
chore(deps): bump lerna to support Prettier 3
lihbr Oct 20, 2023
1444d34
Publish
lihbr Oct 20, 2023
cc61ae6
[1.19.0] fix(init): Rework init end message (#1186)
xrutayisire Oct 23, 2023
94bdad3
Publish
xrutayisire Oct 23, 2023
570d60e
[1.19.0] feat(start-slicemachine): Remove logged in info when startin…
xrutayisire Oct 23, 2023
a37a5da
Publish
xrutayisire Oct 23, 2023
509036c
refactor(slice-machine-ui): merge cards into SharedSliceCard (#1184)
bapmrl Oct 23, 2023
5f14bfc
Publish
bapmrl Oct 23, 2023
f332d95
fix(slice-machine): reconcile state from filesystem when possible (#1…
lihbr Oct 24, 2023
29967a3
Publish
bapmrl Oct 24, 2023
bc0af3a
fix(slice-machine-ui): TableRow's onClick was called unexpectedly
bapmrl Oct 24, 2023
e270b51
Publish
bapmrl Oct 24, 2023
220001d
fix(adapter-nuxt): nuxt 3.8 compatibility (DT-1709) (#1190)
lihbr Oct 25, 2023
6b59039
Publish
lihbr Oct 25, 2023
b4417a6
feat(adapter-sveltekit): support previews (DT-1678,#1173)
angeloashmore Oct 25, 2023
b8bcc6b
Publish
lihbr Oct 25, 2023
12b7e59
test(adapter-sveltekit): prettier v3 programmatic usage
lihbr Oct 25, 2023
3552f44
Publish
lihbr Oct 25, 2023
4c10ae3
fix(manager): screenshot upload concurrency limit (DT-1532) (#1191)
lihbr Oct 25, 2023
242da67
Publish
lihbr Oct 25, 2023
1569022
fix(adapter-sveltekit): enforce Prettier >=3 for code formatting (DT-…
angeloashmore Oct 26, 2023
7258dc0
Publish
bapmrl Oct 26, 2023
e130b26
feat(slice-machine-ui): update Slice Builder layout (#1177)
bapmrl Oct 26, 2023
90a2bba
Publish
bapmrl Oct 26, 2023
e132712
fix(init): Fix failed to create repository error in init (#1179)
xrutayisire Oct 26, 2023
98d1167
Publish
xrutayisire Oct 26, 2023
aa99b8b
fix(slice-machine-ui): infinite loop when adding a screenshot
bapmrl Oct 26, 2023
274d6ad
Publish
bapmrl Oct 26, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions cypress/e2e/customTypes/01-duplicate.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe.skip("Duplicate custom types", () => {
cy.get("[type=submit]").should("be.disabled");

cy.get("[data-cy=ct-name-input-error]").contains(
"Custom type name is already taken."
"Custom type name is already taken.",
);
});

Expand All @@ -34,7 +34,7 @@ describe.skip("Duplicate custom types", () => {
cy.get("[type=submit]").should("be.disabled");

cy.get("[data-cy=ct-id-input-error]").contains(
`ID "${customTypeId}" exists already.`
`ID "${customTypeId}" exists already.`,
);
});
});
23 changes: 5 additions & 18 deletions cypress/e2e/slices/00-create.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ describe("Create Slices", () => {

// add a variation

cy.get("button").contains("Default").click();
cy.contains("+ Add new variation").click();
cy.contains("button", "Add a new variation").click();

cy.getInputByLabel("Variation name*").type("foo");
cy.getInputByLabel("Variation ID*").clear();
Expand All @@ -45,34 +44,22 @@ describe("Create Slices", () => {
cy.get("#simulator-button-tooltip").should("be.visible");
cy.get("#simulator-button-tooltip").should(
"contain",
"Save your work in order to simulate"
);
cy.contains("button", "Update screenshot").should("have.attr", "disabled");
cy.contains("button", "Update screenshot").realHover();
cy.get("#update-screenshot-button-tooltip").should("be.visible");
cy.get("#update-screenshot-button-tooltip").should(
"contain",
"Save your work in order to update the screenshot"
"Save your work in order to simulate",
);

cy.location("pathname", { timeout: 20000 }).should(
"eq",
`/slices/${lib}/${sliceName}/bar`
`/slices/${lib}/${sliceName}/bar`,
);
cy.get("button").contains("foo").click();
cy.contains("Default").click();
cy.contains("a", "Default").click();
cy.location("pathname", { timeout: 20000 }).should(
"eq",
`/slices/${lib}/${sliceName}/default`
`/slices/${lib}/${sliceName}/default`,
);

cy.contains("Save").click();

cy.contains("button", "Simulate").should("not.have.attr", "disabled");
cy.contains("button", "Update screenshot").should(
"not.have.attr",
"disabled"
);

// simulator

Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/slices/01-duplicates.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe("Duplicate Slices", () => {
cy.get("input[data-cy=slice-name-input]").type(sliceName).blur();
cy.get("[type=submit]").should("be.disabled");
cy.get("[data-cy=slice-name-input-error]").contains(
"Slice name is already taken."
"Slice name is already taken.",
);
});
});
2 changes: 1 addition & 1 deletion cypress/e2e/slices/03-build-slices.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe.skip("I am a new SM user (with Next) who wants to build a slice with di
sliceBuilder.addNewWidgetField("SelectField", "Select");
sliceBuilder.addNewWidgetField(
"ContentRelationshipField",
"Content Relationship"
"Content Relationship",
);

sliceBuilder.openEditWidgetModal("SimpleTextField");
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/updates/changelog.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe.skip("changelog.warningBreakingChanges", () => {

it("shows warning if the selected release note has a breaking changes title.", () => {
mockChangelogCall(
"### Breaking Changes\n -this changes is breaking your slice machine"
"### Breaking Changes\n -this changes is breaking your slice machine",
);
cy.visit("/changelog");
cy.waitUntil(() => cy.contains("All versions"));
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/updates/simulator-tooltip.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe("simulator tooltip", () => {
cy.getSliceMachineUserContext().should((data) => {
expect(data.hasSeenSimulatorToolTip).equal(
true,
"userContext.hasSeenSimulatorToolTip should set in local storage"
"userContext.hasSeenSimulatorToolTip should set in local storage",
);
});
});
Expand Down Expand Up @@ -67,7 +67,7 @@ describe("simulator tooltip", () => {
cy.getSliceMachineUserContext().should((data) => {
expect(data.hasSeenSimulatorToolTip).equal(
true,
"userContext.hasSeenSimulatorToolTip should set in local storage"
"userContext.hasSeenSimulatorToolTip should set in local storage",
);
});
});
Expand Down
8 changes: 4 additions & 4 deletions cypress/e2e/updates/video-tooltip.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe.skip("video tooltip", () => {
cy.getSliceMachineUserContext().then((data) => {
expect(data.hasSeenTutorialsToolTip).equal(
true,
"userContext.hasSeenTutorialsToolTip should set in local storage"
"userContext.hasSeenTutorialsToolTip should set in local storage",
);
});
});
Expand All @@ -37,14 +37,14 @@ describe.skip("video tooltip", () => {
.should(
"have.attr",
"href",
"https://youtube.com/playlist?list=PLUVZjQltoA3wnaQudcqQ3qdZNZ6hyfyhH"
"https://youtube.com/playlist?list=PLUVZjQltoA3wnaQudcqQ3qdZNZ6hyfyhH",
)
.click();

cy.getSliceMachineUserContext().should((data) => {
expect(data.hasSeenTutorialsToolTip).equal(
true,
"userContext.hasSeenTutorialsToolTip should set in local storage"
"userContext.hasSeenTutorialsToolTip should set in local storage",
);
});
});
Expand All @@ -68,7 +68,7 @@ describe.skip("video tooltip", () => {
cy.getSliceMachineUserContext().should((data) => {
expect(data.hasSeenTutorialsToolTip).equal(
true,
"userContext.hasSeenTutorialsToolTip should set in local storage"
"userContext.hasSeenTutorialsToolTip should set in local storage",
);
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe.skip("Scenario 008", () => {
.invoke("attr", "aria-checked")
.then((currentValue) => {
cy.wrap(currentValue == "true" ? "false" : "true").as(
"newBooleanValue"
"newBooleanValue",
);
});

Expand All @@ -82,7 +82,7 @@ describe.skip("Scenario 008", () => {

cy.getInputByLabel("SimpleTextField").should(
"contain",
"SimpleTextContent"
"SimpleTextContent",
);
cy.getInputByLabel("RichTextField").should("contain", "RichTextContent");
cy.getInputByLabel("NumberField").should("have.value", "42");
Expand Down
10 changes: 6 additions & 4 deletions cypress/e2e/user-flows/scenario_custom_screenshots.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,23 @@ describe("I am an existing SM user and I want to upload screenshots on variation
});

it("Error displayed when non-image files are uploaded", () => {
const variationName = "Error handling";

sliceBuilder.goTo(slice.library, slice.name);
sliceBuilder.addVariation("Error handling");
sliceBuilder.addVariation(variationName);
sliceBuilder.save();

sliceBuilder.openScreenshotModal();
new SliceCard(slice.name, variationName).openScreenshotModal();
cy.contains("Select file").selectFile(
{
contents: Cypress.Buffer.from("this is not an image"),
fileName: "file.txt",
mimeType: "text/plain",
},
{ action: "drag-drop" }
{ action: "drag-drop" },
);
cy.contains("Only files of type png, jpg, jpeg are accepted.").should(
"be.visible"
"be.visible",
);

screenshotModal.verifyImageIsEmpty().close();
Expand Down
12 changes: 6 additions & 6 deletions cypress/e2e/user-flows/scenario_slice_association.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,25 +49,25 @@ describe.skip("I am an existing SM user (Next) and I want to associate a Slice t
cy.addStaticFieldToSlice(
"Key Text",
"Static Key Text Field",
"static_key_text_id"
"static_key_text_id",
);

cy.addStaticFieldToSlice(
"Rich Text",
"Static Rich Text Field",
"static_rich_text_id"
"static_rich_text_id",
);

cy.addRepeatableFieldToSlice(
"Rich Text",
"Repeatable Rich Text Field",
"repeatable_rich_text_id"
"repeatable_rich_text_id",
);

cy.addRepeatableFieldToSlice(
"Key Text",
"Repeatable Key Text Field",
"repeatable_key_text_id"
"repeatable_key_text_id",
);

sliceBuilder.save();
Expand All @@ -87,7 +87,7 @@ describe.skip("I am an existing SM user (Next) and I want to associate a Slice t
cy.visit(`/custom-types/${customTypeId}`);

cy.get("[data-cy=update-slices]").click();
cy.get(`[data-cy=shared-slice-selection-card-${sliceId}]`).click();
cy.get(`[data-cy=shared-slice-card-${sliceId}]`).click();
cy.get("[data-cy=update-slices-modal]").submit();

customTypeBuilder.save();
Expand Down Expand Up @@ -115,7 +115,7 @@ describe.skip("I am an existing SM user (Next) and I want to associate a Slice t
cy.get("#review-form");
cy.get("[data-cy=review-form-score-3]").click();
cy.get("[data-cy=review-form-comment]").type(
"Cypress test - testing the comment of the survey"
"Cypress test - testing the comment of the survey",
);
cy.get("#review-form").submit();

Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/user-flows/transactional-push.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ describe.skip("I am an existing SM user and I want to push local changes", () =>
changesPage.mockPushError(500).pushChanges();

cy.contains(
"Something went wrong when pushing your changes. Check your terminal logs."
"Something went wrong when pushing your changes. Check your terminal logs.",
);

cy.clearProject();
Expand Down
2 changes: 1 addition & 1 deletion cypress/helpers/customTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function createCustomType(id, name) {

cy.location("pathname", { timeout: 15000 }).should(
"eq",
`/custom-types/${id}`
`/custom-types/${id}`,
);
cy.readFile(TYPES_FILE).should("contains", name);
cy.readFile(CUSTOM_TYPE_MODEL(id));
Expand Down
2 changes: 1 addition & 1 deletion cypress/helpers/filesystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ export function removeTypes() {
*/
export function modifyFile(filePath, updateContent) {
cy.readFile(filePath).then((content) =>
cy.writeFile(filePath, updateContent(content))
cy.writeFile(filePath, updateContent(content)),
);
}
2 changes: 1 addition & 1 deletion cypress/helpers/images.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function isSameImageAs(subject, fixtureImage) {
isCorrectDimensions(
subject,
fixtureImage.naturalWidth,
fixtureImage.naturalHeight
fixtureImage.naturalHeight,
);
resolve();
};
Expand Down
2 changes: 1 addition & 1 deletion cypress/helpers/localStorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export function setSliceMachineUserContext({
lastSyncChange,
hasSeenSimulatorToolTip,
}),
})
}),
);
}

Expand Down
3 changes: 1 addition & 2 deletions cypress/helpers/slices.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function createSlice(lib, id, name) {

cy.location("pathname", { timeout: 20000 }).should(
"eq",
`/slices/${lib}/${name}/default`
`/slices/${lib}/${name}/default`,
);
cy.readFile(TYPES_FILE).should("contains", name);
}
Expand Down Expand Up @@ -121,7 +121,6 @@ function addFieldToSlice(elements, fieldType, fieldName, fieldId) {
* @param {string} variationName Name of the variation.
*/
export function addVariationToSlice(variationName) {
sliceBuilder.variationsDropdown.click({ force: true });
sliceBuilder.addVariationButton.click();

addVariationModal.root.within(() => {
Expand Down
2 changes: 1 addition & 1 deletion cypress/pages/RenameModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class CustomTypeRenameModal extends RenameModal {
constructor() {
super(
"[data-cy=rename-custom-type-modal]",
'[data-cy="custom-type-name-input"]'
'[data-cy="custom-type-name-input"]',
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion cypress/pages/UpdateSliceZoneModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class UpdateSliceZoneModal {
}

selectSlice(sliceId) {
cy.get(`[data-cy=shared-slice-selection-card-${sliceId}]`).click();
cy.get(`[data-cy=shared-slice-card-${sliceId}]`).click();
return this;
}

Expand Down
2 changes: 1 addition & 1 deletion cypress/pages/customTypes/customTypeBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class CustomTypeBuilder extends BaseBuilder {
async addSliceToSliceZone(sliceId) {
await cy.findAllByText(/Add slices/)[0].click();
this.updateSliceZoneButton.click();
cy.get(`[data-cy=shared-slice-selection-card-${sliceId}]`).click();
cy.get(`[data-cy=shared-slice-card-${sliceId}]`).click();
cy.get("[data-cy=update-slices-modal]").submit();
return this;
}
Expand Down
2 changes: 1 addition & 1 deletion cypress/pages/simulator/editorPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class EditorPage {
.then((currentValue) => {
if (currentValue === value) {
throw new Error(
`Cannot toggle "${inputLabel}" to same value (${value})`
`Cannot toggle "${inputLabel}" to same value (${value})`,
);
}
});
Expand Down
2 changes: 1 addition & 1 deletion cypress/pages/slices/screenshotModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ScreenshotModal {
uploadImage(imageFixturePath) {
cy.get(`${this.root} input[type="file"]`).selectFile(
`${fixturePath}${imageFixturePath}`,
{ force: true }
{ force: true },
);
return this;
}
Expand Down
22 changes: 3 additions & 19 deletions cypress/pages/slices/sliceBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,8 @@ class SliceBuilder extends BaseBuilder {
return cy.get("[data-cy=add-Repeatable-field]");
}

get variationsDropdown() {
return cy.get("[aria-label='Expand variations']");
}

get addVariationButton() {
return cy.contains("button", "Add new variation");
return cy.contains("button", "Add a new variation");
}

goTo(sliceLibrary, sliceName, variation = "default") {
Expand All @@ -50,17 +46,6 @@ class SliceBuilder extends BaseBuilder {
return this;
}

openScreenshotModal() {
cy.contains("Update screenshot").click();
return this;
}

openVariationModal() {
cy.get("[aria-label='Expand variations']").parent().click();
cy.contains("Add new variation").click();
return this;
}

changeToVariation(startVariation, targetVariation) {
cy.get("button").contains(startVariation).click();
cy.contains(targetVariation).click();
Expand All @@ -83,7 +68,7 @@ class SliceBuilder extends BaseBuilder {
.callsFake((url) => {
simUrl = url;
console.log(
`window.open() won't be called as it currently generates a timeout in cypress. Calling cy.visit('${url}') instead.`
`window.open() won't be called as it currently generates a timeout in cypress. Calling cy.visit('${url}') instead.`,
);
// win.open.wrappedMethod.call(win, url, "_self");
});
Expand All @@ -103,8 +88,7 @@ class SliceBuilder extends BaseBuilder {
* @param {string} variationName Name of the variation.
*/
addVariation(variationName) {
cy.get("[aria-label='Expand variations']").click({ force: true });
cy.contains("button", "Add new variation").click();
cy.contains("button", "Add a new variation").click();

cy.get("[aria-modal]").within(() => {
cy.getInputByLabel("Variation name*").type(variationName);
Expand Down
Loading