Skip to content

Commit

Permalink
e2e fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminpkane committed Sep 27, 2024
1 parent 10cf4a0 commit bad935e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ const ListValueEntry = ({
</span>
<Arrow
key="arrow"
data-cy={`sidebar-field-arrow-enabled-${path}`}
style={{ cursor: "pointer", margin: 0 }}
onClick={(event) => {
event.preventDefault();
Expand Down Expand Up @@ -255,7 +256,7 @@ const ListLoadable = ({ path }: { path: string }) => {
}, [data, field, fields, timeZone]);

return (
<ListContainer>
<ListContainer data-cy={`sidebar-entry-${path}`}>
{values.map((v, i) => (
<div key={i.toString()} title={typeof v === "string" ? v : undefined}>
{v === null ? "None" : v}
Expand Down Expand Up @@ -531,12 +532,12 @@ const formatObject = ({

return (
<div
data-cy={`${k}-${text}`}
data-cy={`key-value-${k}-${text}`}
key={k}
style={{ display: "flex", justifyContent: "space-between" }}
>
<span data-cy={k}>{k}</span>
<span data-cy={text}>{text}</span>
<span data-cy={`key-${k}`}>{k}</span>
<span data-cy={`value-${text}`}>{text}</span>
</div>
);
})
Expand Down
6 changes: 3 additions & 3 deletions e2e-pw/src/oss/poms/modal/modal-sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@ class SidebarAsserter {

for (const k in obj) {
const v = obj[k];
const entry = locator.getByTestId(`${k}-${v}`);
const entry = locator.getByTestId(`key-value-${k}-${v}`);

await expect(entry.getByTestId(k)).toHaveText(k);
await expect(entry.getByTestId(v)).toHaveText(v);
await expect(entry.getByTestId(`key-${k}`)).toHaveText(k);
await expect(entry.getByTestId(`value-${v}`)).toHaveText(v);
}
}

Expand Down
6 changes: 6 additions & 0 deletions e2e-pw/src/oss/specs/smoke-tests/summary-fields.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ test.describe("summary fields", () => {
});

test("modal sidebar summary fields render", async ({
eventUtils,
fiftyoneLoader,
grid,
modal,
Expand All @@ -54,7 +55,12 @@ test.describe("summary fields", () => {
one: "two",
three: "four",
});
const entryExpandPromise = eventUtils.getEventReceivedPromiseForPredicate(
"animation-onRest",
() => true
);
await modal.sidebar.clickFieldDropdown("summaries");
await entryExpandPromise;
await modal.sidebar.assert.verifyObject("summaries", {
five: "six",
seven: "eight",
Expand Down

0 comments on commit bad935e

Please sign in to comment.