Skip to content

Commit

Permalink
fix: model uncontained test
Browse files Browse the repository at this point in the history
  • Loading branch information
roar-larsen authored and pbullhove committed Nov 29, 2023
1 parent 414283f commit 264e4f9
Showing 1 changed file with 15 additions and 26 deletions.
41 changes: 15 additions & 26 deletions e2e/tests/plugin-form-model_uncontained-complex_attribute.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ test('Model uncontained complex attribute', async ({ page }) => {
await page.getByRole('button', { name: 'Edit' }).click()
await expect(page.getByLabel('Name')).toHaveValue('TheBlackPearl')
await page.getByRole('button', { name: 'Open in tab', exact: true }).click()
await expect(page.getByRole('tab', { name: 'captain' })).toBeVisible()
await expect(page.getByRole('code')).toBeVisible()
await page.getByRole('button', { name: 'Edit' }).nth(1).click()
await expect(page.getByTestId('form-text-widget-name').nth(1)).toHaveValue(
Expand All @@ -27,39 +28,27 @@ test('Model uncontained complex attribute', async ({ page }) => {
page.getByTestId('form-number-widget-Phone Number (optional)')
).toHaveValue('0')
await page.getByLabel('Close captain').click()
await expect(page.getByRole('tab', { name: 'captain' })).not.toBeVisible()
})

await test.step('Update model uncontained', async () => {
await page
.getByRole('button', { name: 'Edit and save', exact: true })
.click()
await page
.getByTestId('captain')
.getByRole('button', { name: 'DemoDataSource' })
.click()
await page
.getByTestId('captain')
.getByRole('button', { name: 'plugins' })
.click()
await page
.getByTestId('captain')
.getByRole('button', { name: 'form' })
.click()
await page
.getByTestId('captain')
.getByRole('button', { name: 'model_uncontained' })
.click()
await page
.getByTestId('captain')
.getByRole('button', { name: 'complex_attribute' })
.click()
await page
.getByTestId('captain')
.getByRole('button', { name: 'Barbossa' })
.click()
await page.getByRole('button', { name: 'Select', exact: true }).click()
await page.waitForTimeout(1000)

const dialog = page.getByRole('dialog')
await expect(dialog).toBeVisible()
await dialog.getByRole('button', { name: 'DemoDataSource' }).click()
await dialog.getByRole('button', { name: 'plugins' }).click()
await dialog.getByRole('button', { name: 'form' }).click()
await dialog.getByRole('button', { name: 'model_uncontained' }).click()
await dialog.getByRole('button', { name: 'complex_attribute' }).click()
await dialog.getByRole('button', { name: 'Barbossa' }).click()
await dialog.getByRole('button', { name: 'Select', exact: true }).click()
await expect(dialog).not.toBeVisible()

await page.getByRole('button', { name: 'Open in tab', exact: true }).click()
await expect(page.getByRole('tab', { name: 'captain' })).toBeVisible()
await expect(page.getByRole('code')).toBeVisible()
await page.getByRole('button', { name: 'Edit' }).nth(1).click()
await expect(page.getByTestId('form-text-widget-name').nth(1)).toHaveValue(
Expand Down

0 comments on commit 264e4f9

Please sign in to comment.