mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-13 08:06:24 +08:00
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:
@@ -118,7 +118,6 @@ export const TrashOperationCell: React.FC<TrashOperationCellProps> = ({
|
||||
pageMeta,
|
||||
onPermanentlyDeletePage,
|
||||
onRestorePage,
|
||||
onOpenPage,
|
||||
}) => {
|
||||
const { id, title } = pageMeta;
|
||||
const { t } = useTranslation();
|
||||
@@ -132,7 +131,6 @@ export const TrashOperationCell: React.FC<TrashOperationCellProps> = ({
|
||||
onClick={() => {
|
||||
onRestorePage(id);
|
||||
toast(t('restored', { title: title || 'Untitled' }));
|
||||
onOpenPage(id);
|
||||
}}
|
||||
>
|
||||
<ResetIcon />
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user