feat: new sidebar (app shell) styles (#2303)

This commit is contained in:
Peng Xiao
2023-05-12 11:13:51 +08:00
committed by LongYinan
parent add5deae0f
commit 683343ad82
54 changed files with 1166 additions and 642 deletions
@@ -18,7 +18,7 @@ test('New a page , then delete it in all pages, permanently delete it', async ({
await getBlockSuiteEditorTitle(page).click();
await getBlockSuiteEditorTitle(page).fill('this is a new page to restore');
const newPageId = page.url().split('/').reverse()[0];
await page.getByRole('link', { name: 'All pages' }).click();
await page.getByTestId('all-pages').click();
const cell = page.getByRole('cell', {
name: 'this is a new page to restore',
});
@@ -36,7 +36,7 @@ test('New a page , then delete it in all pages, permanently delete it', async ({
await page.getByRole('button', { name: 'Delete' }).click();
await page.getByRole('link', { name: 'Trash' }).click();
await page.getByTestId('trash-page').click();
// permanently delete it
await page
.getByTestId('more-actions-' + newPageId)
@@ -18,7 +18,7 @@ test.skip('New a page ,then open it and export html', async ({ page }) => {
await page
.getByPlaceholder('Title')
.fill('this is a new page to export html content');
await page.getByRole('link', { name: 'All pages' }).click();
await page.getByTestId('all-pages').click();
const cell = page.getByRole('cell', {
name: 'this is a new page to export html content',
@@ -46,7 +46,7 @@ test.skip('New a page ,then open it and export markdown', async ({ page }) => {
await page
.getByPlaceholder('Title')
.fill('this is a new page to export markdown content');
await page.getByRole('link', { name: 'All pages' }).click();
await page.getByTestId('all-pages').click();
const cell = page.getByRole('cell', {
name: 'this is a new page to export markdown content',
});
@@ -16,7 +16,7 @@ test('New a page and open it ,then favorite it', async ({ page }) => {
await newPage(page);
await getBlockSuiteEditorTitle(page).click();
await getBlockSuiteEditorTitle(page).fill('this is a new page to favorite');
await page.getByRole('link', { name: 'All pages' }).click();
await page.getByTestId('all-pages').click();
const cell = page.getByRole('cell', {
name: 'this is a new page to favorite',
});
@@ -55,7 +55,7 @@ test('Cancel favorite', async ({ page }) => {
await newPage(page);
await getBlockSuiteEditorTitle(page).click();
await getBlockSuiteEditorTitle(page).fill('this is a new page to favorite');
await page.getByRole('link', { name: 'All pages' }).click();
await page.getByTestId('all-pages').click();
const cell = page.getByRole('cell', {
name: 'this is a new page to favorite',
});
@@ -68,14 +68,13 @@ test('Cancel favorite', async ({ page }) => {
await favoriteBtn.click();
// expect it in favorite list
await page.getByRole('link', { name: 'Favorites' }).click();
expect(
page.getByRole('cell', { name: 'this is a new page to favorite' })
).not.toBeUndefined();
// cancel favorite
await page.getByRole('link', { name: 'All pages' }).click();
await page.getByTestId('all-pages').click();
const box = await page
.getByRole('cell', { name: 'this is a new page to favorite' })
@@ -86,7 +85,6 @@ test('Cancel favorite', async ({ page }) => {
await page.getByTestId('favorited-icon').click();
// expect it not in favorite list
await page.getByRole('link', { name: 'Favorites' }).click();
expect(
page.getByText(
'Tips: Click Add to Favorites/Trash and the page will appear here.'
@@ -8,7 +8,6 @@ import {
newPage,
waitMarkdownImported,
} from '../libs/page-logic';
import { assertCurrentWorkspaceFlavour } from '../libs/workspace';
test('Show favorite items in sidebar', async ({ page }) => {
await openHomePage(page);
@@ -17,7 +16,7 @@ test('Show favorite items in sidebar', async ({ page }) => {
await getBlockSuiteEditorTitle(page).click();
await getBlockSuiteEditorTitle(page).fill('this is a new page to favorite');
const newPageId = page.url().split('/').reverse()[0];
await page.getByRole('link', { name: 'All pages' }).click();
await page.getByTestId('all-pages').click();
const cell = page.getByRole('cell', {
name: 'this is a new page to favorite',
});
@@ -41,7 +40,7 @@ test('Show favorite items in favorite list', async ({ page }) => {
await newPage(page);
await getBlockSuiteEditorTitle(page).click();
await getBlockSuiteEditorTitle(page).fill('this is a new page to favorite');
await page.getByRole('link', { name: 'All pages' }).click();
await page.getByTestId('all-pages').click();
const cell = page.getByRole('cell', {
name: 'this is a new page to favorite',
});
@@ -52,16 +51,11 @@ test('Show favorite items in favorite list', async ({ page }) => {
const favoriteBtn = page.getByTestId('editor-option-menu-favorite');
await favoriteBtn.click();
await page.getByRole('link', { name: 'Favorites' }).click();
await page.getByTestId('all-pages').click();
expect(
page.getByRole('cell', { name: 'this is a new page to favorite' })
).not.toBeUndefined();
await page.getByRole('cell').getByRole('button').nth(0).click();
expect(
await page
.getByText('Click Add to Favorites and the page will appear here.')
.isVisible()
).toBe(true);
await assertCurrentWorkspaceFlavour('local', page);
});
+1 -1
View File
@@ -25,7 +25,7 @@ test('click btn bew page and find it in all pages', async ({ page }) => {
await newPage(page);
await getBlockSuiteEditorTitle(page).click();
await getBlockSuiteEditorTitle(page).fill('this is a new page');
await page.getByRole('link', { name: 'All pages' }).click();
await page.getByTestId('all-pages').click();
const cell = page.getByRole('cell', { name: 'this is a new page' });
expect(cell).not.toBeUndefined();
await assertCurrentWorkspaceFlavour('local', page);
@@ -18,7 +18,7 @@ test('click btn bew page and open in tab', async ({ page }) => {
const newPageUrl = page.url();
const newPageId = page.url().split('/').reverse()[0];
await page.getByRole('link', { name: 'All pages' }).click();
await page.getByTestId('all-pages').click();
await page
.getByTestId('more-actions-' + newPageId)
@@ -18,7 +18,7 @@ test('New a page , then delete it in all pages, restore it', async ({
await getBlockSuiteEditorTitle(page).click();
await getBlockSuiteEditorTitle(page).fill('this is a new page to restore');
const newPageId = page.url().split('/').reverse()[0];
await page.getByRole('link', { name: 'All pages' }).click();
await page.getByTestId('all-pages').click();
const cell = page.getByRole('cell', {
name: 'this is a new page to restore',
});
@@ -36,7 +36,7 @@ test('New a page , then delete it in all pages, restore it', async ({
await page.getByRole('button', { name: 'Delete' }).click();
await page.getByRole('link', { name: 'Trash' }).click();
await page.getByTestId('trash-page').click();
await page.waitForTimeout(50);
const trashPage = page.url();
// restore it
@@ -48,7 +48,7 @@ test('New a page , then delete it in all pages, restore it', async ({
// stay in trash page
expect(page.url()).toBe(trashPage);
await page.getByRole('link', { name: 'All pages' }).click();
await page.getByTestId('all-pages').click();
const restoreCell = page.getByRole('cell', {
name: 'this is a new page to restore',
});
@@ -16,7 +16,7 @@ test('New a page ,then open it and show delete modal', async ({ page }) => {
await newPage(page);
await getBlockSuiteEditorTitle(page).click();
await getBlockSuiteEditorTitle(page).fill('this is a new page to delete');
await page.getByRole('link', { name: 'All pages' }).click();
await page.getByTestId('all-pages').click();
const cell = page.getByRole('cell', {
name: 'this is a new page to delete',
});
@@ -40,7 +40,7 @@ test('New a page ,then go to all pages and show delete modal', async ({
await getBlockSuiteEditorTitle(page).click();
await getBlockSuiteEditorTitle(page).fill('this is a new page to delete');
const newPageId = page.url().split('/').reverse()[0];
await page.getByRole('link', { name: 'All pages' }).click();
await page.getByTestId('all-pages').click();
const cell = page.getByRole('cell', {
name: 'this is a new page to delete',
});
@@ -18,7 +18,7 @@ test('New a page , then delete it in all pages, finally find it in trash', async
await getBlockSuiteEditorTitle(page).click();
await getBlockSuiteEditorTitle(page).fill('this is a new page to delete');
const newPageId = page.url().split('/').reverse()[0];
await page.getByRole('link', { name: 'All pages' }).click();
await page.getByTestId('all-pages').click();
const cell = page.getByRole('cell', {
name: 'this is a new page to delete',
});
@@ -36,7 +36,7 @@ test('New a page , then delete it in all pages, finally find it in trash', async
await page.getByRole('button', { name: 'Delete' }).click();
await page.getByRole('link', { name: 'Trash' }).click();
await page.getByTestId('trash-page').click();
expect(
page.getByRole('cell', { name: 'this is a new page to delete' })
).not.toBeUndefined();
+1 -1
View File
@@ -48,7 +48,7 @@ test('Click right-bottom corner change log icon', async ({ page }) => {
);
await page.waitForTimeout(50);
expect(await editorRightBottomChangeLog.isVisible()).toEqual(true);
await page.getByRole('link', { name: 'All pages' }).click();
await page.getByTestId('all-pages').click();
const normalRightBottomChangeLog = page.locator(
'[data-testid=right-bottom-change-log-icon]'
);