From c447421b0557bb98d406cdda51494c4e97b04feb Mon Sep 17 00:00:00 2001 From: Jarrod Flesch Date: Mon, 6 Mar 2023 17:06:37 -0500 Subject: [PATCH] chore: fixes outdated json field test --- test/fields/e2e.spec.ts | 2 +- test/helpers.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/fields/e2e.spec.ts b/test/fields/e2e.spec.ts index ac9fe2b4eb..cfa9c7dd4b 100644 --- a/test/fields/e2e.spec.ts +++ b/test/fields/e2e.spec.ts @@ -86,7 +86,7 @@ describe('fields', () => { const json = page.locator('.json-field .inputarea'); await json.fill(input); - await saveDocAndAssert(page); + await saveDocAndAssert(page, '.form-submit button'); await expect(page.locator('.json-field')).toContainText('"foo": "bar"'); }); }); diff --git a/test/helpers.ts b/test/helpers.ts index 69ea35f90d..40afe7d681 100644 --- a/test/helpers.ts +++ b/test/helpers.ts @@ -36,8 +36,8 @@ export async function login(args: LoginArgs): Promise { await page.waitForURL(`${serverURL}/admin`); } -export async function saveDocAndAssert(page: Page): Promise { - await page.click('#action-save', { delay: 100 }); +export async function saveDocAndAssert(page: Page, selector = '#action-save'): Promise { + await page.click(selector, { delay: 100 }); await expect(page.locator('.Toastify')).toContainText('successfully'); expect(page.url()).not.toContain('create'); }