Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: integration tests #1460

Merged
merged 5 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion e2e/tests/plugin-explorer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from '@playwright/test'

test.describe.configure({ mode: 'serial' })

test.beforeEach(async ({ page }) => {
test.beforeEach(async ({ page, browser }) => {
await page.goto('http://localhost:3000/')
await page.getByRole('button', { name: 'data source DemoDataSource' }).click()
await page.getByRole('button', { name: 'root package plugins' }).click()
Expand Down Expand Up @@ -44,6 +44,7 @@ test('Create entity with name', async ({ page }) => {
await page
.getByRole('button', { name: 'package Playwright', exact: true })
.click({ button: 'right' })
await page.mouse.wheel(0, 300)
await page.getByRole('menuitem', { name: 'New entity' }).click()
const dialog = page.getByRole('dialog')
await expect(dialog).toBeVisible()
Expand Down Expand Up @@ -80,6 +81,7 @@ test('Create entity with required name', async ({ page }) => {
await page.getByRole('button', { name: 'uncontained_object' }).click({
button: 'right',
})
await page.mouse.wheel(0, -300)
await page.getByRole('menuitem', { name: 'New entity' }).click()
const dialog = page.getByRole('dialog')
await expect(dialog).toBeVisible()
Expand Down
1 change: 0 additions & 1 deletion e2e/tests/plugin-list-task_list.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ test('task list', async ({ page }) => {
).toHaveValue('Wash the car')
await contentWrapper.getByText('Mark task as complete').click()
await contentWrapper.getByRole('button', { name: 'Submit' }).click()
await expect(page.getByRole('alert')).toHaveText(['Document updated'])
await page.getByLabel('Close task_list').click()
await page.getByTestId('task_list').getByLabel('Open in tab').click()
await page
Expand Down
4 changes: 2 additions & 2 deletions e2e/tests/plugin-view_selector-car_garage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ test('View selector - car garage', async ({ page }) => {

await test.step('Collapse and expand sidebar', async () => {
await page.getByRole('tab', { name: 'Self' }).click()
await page.getByRole('button', { name: 'Collapse' }).click()
await page.getByRole('button', { name: 'Collapse sidebar' }).click()
await expect(page.getByRole('tab', { name: 'Self' })).not.toBeVisible()
await expect(page.getByRole('tab', { name: 'Audi' })).not.toBeVisible()
await expect(page.getByRole('tab', { name: 'Volvo' })).not.toBeVisible()
Expand All @@ -23,7 +23,7 @@ test('View selector - car garage', async ({ page }) => {
)
await page.getByRole('tab').first().click()
await expect(page.getByLabel('Name')).toHaveValue('CarGarage')
await page.getByRole('button', { name: 'Expand' }).click()
await page.getByRole('button', { name: 'Expand sidebar' }).click()
await expect(page.getByRole('tab', { name: 'Self' })).toBeVisible()
await expect(page.getByRole('tab', { name: 'Audi' })).toBeVisible()
await expect(page.getByRole('tab', { name: 'Volvo' })).toBeVisible()
Expand Down
1 change: 1 addition & 0 deletions packages/dm-core-plugins/src/view_selector/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ export const Sidebar = (props: {
<SideBar.Footer style={{ display: 'flex', justifyContent: 'flex-end' }}>
<CustomToggle expanded={isOpen}>
<Button
aria-label={isOpen ? 'Collapse sidebar' : 'Expand sidebar'}
onClick={() => setIsOpen(!isOpen)}
variant='ghost_icon'
color='secondary'
Expand Down
Loading