2024-01-31 14:35:41 +03:00
|
|
|
/** @file Test copying, moving, cutting and pasting. */
|
|
|
|
import * as test from '@playwright/test'
|
|
|
|
|
|
|
|
import * as actions from './actions'
|
|
|
|
|
2024-06-20 19:19:01 +03:00
|
|
|
test.test('delete and restore', ({ page }) =>
|
2024-07-16 12:55:45 +03:00
|
|
|
actions
|
|
|
|
.mockAllAndLogin({ page })
|
|
|
|
.createFolder()
|
|
|
|
.driveTable.withRows(async (rows) => {
|
|
|
|
await test.expect(rows).toHaveCount(1)
|
|
|
|
})
|
|
|
|
.driveTable.rightClickRow(0)
|
|
|
|
.contextMenu.moveToTrash()
|
|
|
|
.driveTable.expectPlaceholderRow()
|
|
|
|
.goToCategory.trash()
|
|
|
|
.driveTable.withRows(async (rows) => {
|
|
|
|
await test.expect(rows).toHaveCount(1)
|
|
|
|
})
|
|
|
|
.driveTable.rightClickRow(0)
|
|
|
|
.contextMenu.restoreFromTrash()
|
|
|
|
.driveTable.expectTrashPlaceholderRow()
|
|
|
|
.goToCategory.cloud()
|
|
|
|
.driveTable.withRows(async (rows) => {
|
|
|
|
await test.expect(rows).toHaveCount(1)
|
|
|
|
}),
|
2024-06-20 19:19:01 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
test.test('delete and restore (keyboard)', ({ page }) =>
|
2024-07-16 12:55:45 +03:00
|
|
|
actions
|
|
|
|
.mockAllAndLogin({ page })
|
|
|
|
.createFolder()
|
|
|
|
.driveTable.withRows(async (rows) => {
|
|
|
|
await test.expect(rows).toHaveCount(1)
|
|
|
|
})
|
|
|
|
.driveTable.clickRow(0)
|
|
|
|
.press('Delete')
|
|
|
|
.driveTable.expectPlaceholderRow()
|
|
|
|
.goToCategory.trash()
|
|
|
|
.driveTable.withRows(async (rows) => {
|
|
|
|
await test.expect(rows).toHaveCount(1)
|
|
|
|
})
|
|
|
|
.driveTable.clickRow(0)
|
|
|
|
.press('Mod+R')
|
|
|
|
.driveTable.expectTrashPlaceholderRow()
|
|
|
|
.goToCategory.cloud()
|
|
|
|
.driveTable.withRows(async (rows) => {
|
|
|
|
await test.expect(rows).toHaveCount(1)
|
|
|
|
}),
|
2024-06-20 19:19:01 +03:00
|
|
|
)
|