fix: trash restore (#1446)

Co-authored-by: DarkSky <25152247+darkskygit@users.noreply.github.com>
Co-authored-by: Himself65 <himself65@outlook.com>
This commit is contained in:
VictorNanka
2023-03-17 11:55:35 +09:00
committed by GitHub
parent d1722bc235
commit 110cec7bf6
2 changed files with 3 additions and 6 deletions

View File

@@ -12,7 +12,6 @@ test.describe('Local first delete page', () => {
await newPage(page);
await getBlockSuiteEditorTitle(page).click();
await getBlockSuiteEditorTitle(page).fill('this is a new page to restore');
const originPageUrl = page.url();
const newPageId = page.url().split('/').reverse()[0];
await page.getByRole('link', { name: 'All pages' }).click();
const cell = page.getByRole('cell', {
@@ -33,6 +32,7 @@ test.describe('Local first delete page', () => {
await page.getByRole('button', { name: 'Delete' }).click();
await page.getByRole('link', { name: 'Trash' }).click();
const trashPage = await page.url();
// restore it
await page
.getByTestId('more-actions-' + newPageId)
@@ -40,9 +40,8 @@ test.describe('Local first delete page', () => {
.first()
.click();
// go to page detail
expect(page.url()).toBe(originPageUrl);
// stay in trash page
expect(page.url()).toBe(trashPage);
await page.getByRole('link', { name: 'All pages' }).click();
const restoreCell = page.getByRole('cell', {
name: 'this is a new page to restore',