chore: fixes outdated json field test
This commit is contained in:
@@ -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"');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user