Skip to content

Commit

Permalink
Update test now that label updates are actually reflected in the form…
Browse files Browse the repository at this point in the history
… builder
  • Loading branch information
kalilsn committed Mar 3, 2025
1 parent b8096b8 commit 4e486f7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions core/playwright/formBuilder.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,9 @@ test.describe("relationship fields", () => {
if (request.method() === "POST" && request.url().includes(`forms/${formSlug}/edit`)) {
const data = request.postDataJSON();
const { elements } = data[0];
const authorElement = elements.find((e: PubFieldElement) => e.label === "author");
const authorElement = elements.find(
(e: PubFieldElement) => "label" in e.config && e.config.label === "Role"
);
expect(authorElement.component).toEqual(InputComponent.textArea);
expect(authorElement.config).toMatchObject({
relationshipConfig: {
Expand Down Expand Up @@ -219,7 +221,9 @@ test.describe("relationship fields", () => {
const data = request.postDataJSON();
const { elements } = data[0];
const authorElement = elements.find(
(e: PubFieldElement) => e.label === "author null"
(e: PubFieldElement) =>
"relationshipConfig" in e.config &&
e.config.relationshipConfig.label === "Authors"
);
expect(authorElement.component).toBeNull();
expect(authorElement.config).toMatchObject({
Expand Down

0 comments on commit 4e486f7

Please sign in to comment.