Skip to content

Commit

Permalink
test(dev): add test
Browse files Browse the repository at this point in the history
  • Loading branch information
RitaDias committed Aug 6, 2024
1 parent 2c84413 commit 8df353f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/e2e/tests/plugins/media.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import {expect} from '@playwright/test'
import {test} from '@sanity/test'

test('media plugin should open', async ({page, createDraftDocument}) => {
await createDraftDocument('/test/content/input-standard;imagesTest')
const imageInput = page.getByTestId('change-bar__field-wrapper').nth(2)

expect(await imageInput).toBeVisible()

expect(await page.locator('#mainImage_assetImageButton')).toBeVisible()
await page.locator('#mainImage_assetImageButton').click()

expect(await page.getByTestId('file-input-multi-button-media')).toBeVisible()
await page.getByTestId('file-input-browse-button-media').click()

expect(await page.getByTestId('media-plugin')).toBeVisible()
})

0 comments on commit 8df353f

Please sign in to comment.