chore: fixes outdated json field test

This commit is contained in:
Jarrod Flesch
2023-03-06 17:06:37 -05:00
parent ace032ef89
commit c447421b05
2 changed files with 3 additions and 3 deletions

View File

@@ -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"');
});
});

View File

@@ -36,8 +36,8 @@ export async function login(args: LoginArgs): Promise<void> {
await page.waitForURL(`${serverURL}/admin`);
}
export async function saveDocAndAssert(page: Page): Promise<void> {
await page.click('#action-save', { delay: 100 });
export async function saveDocAndAssert(page: Page, selector = '#action-save'): Promise<void> {
await page.click(selector, { delay: 100 });
await expect(page.locator('.Toastify')).toContainText('successfully');
expect(page.url()).not.toContain('create');
}