test: open public workspace (#1736)
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
import { Breadcrumbs, IconButton, ListSkeleton } from '@affine/component';
|
import { Breadcrumbs, IconButton, ListSkeleton } from '@affine/component';
|
||||||
import { SearchIcon } from '@blocksuite/icons';
|
import { SearchIcon } from '@blocksuite/icons';
|
||||||
import { Box } from '@mui/material';
|
|
||||||
import { useAtomValue, useSetAtom } from 'jotai';
|
import { useAtomValue, useSetAtom } from 'jotai';
|
||||||
import dynamic from 'next/dynamic';
|
import dynamic from 'next/dynamic';
|
||||||
import { useRouter } from 'next/router';
|
import { useRouter } from 'next/router';
|
||||||
@@ -68,11 +67,6 @@ const ListPageInner: React.FC<{
|
|||||||
<span>{name}</span>
|
<span>{name}</span>
|
||||||
</StyledBreadcrumbs>
|
</StyledBreadcrumbs>
|
||||||
</Breadcrumbs>
|
</Breadcrumbs>
|
||||||
<Box
|
|
||||||
sx={{
|
|
||||||
flex: 1,
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<IconButton onClick={handleOpen}>
|
<IconButton onClick={handleOpen}>
|
||||||
<SearchIcon />
|
<SearchIcon />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ export const NavContainer = styled('div')(({ theme }) => {
|
|||||||
return {
|
return {
|
||||||
width: '100vw',
|
width: '100vw',
|
||||||
height: '60px',
|
height: '60px',
|
||||||
...displayFlex('start', 'center'),
|
...displayFlex('space-between', 'center'),
|
||||||
backgroundColor: theme.colors.pageBackground,
|
backgroundColor: theme.colors.pageBackground,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -8,14 +8,14 @@ import { createFakeUser, loginUser, openHomePage } from '../../libs/utils';
|
|||||||
import { createWorkspace } from '../../libs/workspace';
|
import { createWorkspace } from '../../libs/workspace';
|
||||||
|
|
||||||
test.describe('affine public workspace', () => {
|
test.describe('affine public workspace', () => {
|
||||||
test('enable public workspace', async ({ page }) => {
|
test('enable public workspace', async ({ page, context }) => {
|
||||||
await openHomePage(page);
|
await openHomePage(page);
|
||||||
await waitMarkdownImported(page);
|
await waitMarkdownImported(page);
|
||||||
const [a] = await createFakeUser();
|
const [a] = await createFakeUser();
|
||||||
await loginUser(page, a);
|
await loginUser(page, a);
|
||||||
const name = `test-${Date.now()}`;
|
const name = `test-${Date.now()}`;
|
||||||
await createWorkspace({ name }, page);
|
await createWorkspace({ name }, page);
|
||||||
await page.waitForTimeout(50);
|
await waitMarkdownImported(page);
|
||||||
await clickSideBarSettingButton(page);
|
await clickSideBarSettingButton(page);
|
||||||
await page.waitForTimeout(50);
|
await page.waitForTimeout(50);
|
||||||
await clickPublishPanel(page);
|
await clickPublishPanel(page);
|
||||||
@@ -32,5 +32,9 @@ test.describe('affine public workspace', () => {
|
|||||||
expect(url.startsWith('http://localhost:8080/public-workspace/')).toBe(
|
expect(url.startsWith('http://localhost:8080/public-workspace/')).toBe(
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
const page2 = await context.newPage();
|
||||||
|
await page2.goto(url);
|
||||||
|
await page2.waitForSelector('thead');
|
||||||
|
await page2.getByText('Welcome to AFFiNE').click();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user