enso/app/ide-desktop/lib/dashboard/e2e/driveView.spec.ts
Sergei Garin e4da96e943
Fix opening projects (#10433)
#### Tl;dr
- Closes: enso-org/cloud-v2#1338
This PR fixes bugs with opened projects. Now all projects close/open properly and list of opened projects stored in the single place

---

#### Context:
Few sentences on the high level context for the change. Link to relevant design docs or discussion.

#### This Change:
What this change does in the larger context. Specific details to highlight for review:
1. Removes a bunch of useEffects across the Dashboard page
2. Project status now a react-query state, can be reused across the app
3. Eliminated the need of `waitIntilProjectIsOpened`

---
2024-07-09 14:47:46 +00:00

53 lines
1.9 KiB
TypeScript

/** @file Test the drive view. */
import * as test from '@playwright/test'
import * as actions from './actions'
test.test('drive view', ({ page }) =>
actions.mockAllAndLogin({ page }).then(
async ({ pageActions }) =>
await pageActions
.withDriveView(async view => {
await test.expect(view).toBeVisible()
})
.driveTable.expectPlaceholderRow()
.newEmptyProject()
.do(async () => {
await test.expect(actions.locateEditor(page)).toBeAttached()
})
.goToPage.drive()
.driveTable.withRows(async rows => {
await test.expect(rows).toHaveCount(1)
})
.do(async () => {
await test.expect(actions.locateAssetsTable(page)).toBeVisible()
})
.newEmptyProject()
.do(async () => {
await test.expect(actions.locateEditor(page)).toBeAttached()
})
.goToPage.drive()
.driveTable.withRows(async rows => {
await test.expect(rows).toHaveCount(2)
})
// The last opened project needs to be stopped, to remove the toast notification notifying the
// user that project creation may take a while. Previously opened projects are stopped when the
// new project is created.
.driveTable.withRows(async rows => {
await actions.locateStopProjectButton(rows.nth(0)).click()
})
// FIXME(#10488): This test fails because the mock endpoint returns the project is opened,
// but it must be stopped first to delete the project.
// Project context menu
// .driveTable.rightClickRow(0)
// .withContextMenus(async menus => {
// // actions.locateContextMenus(page)
// await test.expect(menus).toBeVisible()
// })
// .contextMenu.moveToTrash()
// .driveTable.withRows(async rows => {
// await test.expect(rows).toHaveCount(1)
// })
)
)