mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-17 01:56:27 +08:00
Merge branch 'feat/filesystem_and_search' of github.com:toeverything/AFFiNE into feat/filesystem_and_search
This commit is contained in:
@@ -11,7 +11,7 @@ interface LoginModalProps {
|
||||
|
||||
export const LoginModal = ({ open, onClose }: LoginModalProps) => {
|
||||
return (
|
||||
<Modal open={open} onClose={onClose}>
|
||||
<Modal open={open} onClose={onClose} data-testid="login-modal">
|
||||
<ModalWrapper width={620} height={334}>
|
||||
<Header>
|
||||
<ModalCloseButton
|
||||
|
||||
+6
-2
@@ -1,5 +1,6 @@
|
||||
import { useModal } from '@/providers/global-modal-provider';
|
||||
import { styled } from '@/styles';
|
||||
import { AffineIcon } from '../../icons/icons';
|
||||
import {
|
||||
WorkspaceItemAvatar,
|
||||
LoginItemWrapper,
|
||||
@@ -9,9 +10,12 @@ import {
|
||||
export const LoginItem = () => {
|
||||
const { triggerLoginModal } = useModal();
|
||||
return (
|
||||
<LoginItemWrapper onClick={() => triggerLoginModal()}>
|
||||
<LoginItemWrapper
|
||||
onClick={() => triggerLoginModal()}
|
||||
data-testid="open-login-modal"
|
||||
>
|
||||
<WorkspaceItemAvatar alt="AFFiNE" src={''}>
|
||||
A
|
||||
<AffineIcon />
|
||||
</WorkspaceItemAvatar>
|
||||
<WorkspaceItemContent>
|
||||
<Name title="AFFiNE">AFFiNE</Name>
|
||||
|
||||
+4
-2
@@ -4,7 +4,7 @@ import { SelectorPopperContent } from './SelectorPopperContent';
|
||||
import { useState } from 'react';
|
||||
import { useAppState } from '@/providers/app-state-provider';
|
||||
import { WorkspaceType } from '@pathfinder/data-services';
|
||||
|
||||
import { AffineIcon } from '../icons/icons';
|
||||
export const WorkspaceSelector = () => {
|
||||
const [isShow, setIsShow] = useState(false);
|
||||
const { currentWorkspace, workspacesMeta, currentWorkspaceId, user } =
|
||||
@@ -21,7 +21,9 @@ export const WorkspaceSelector = () => {
|
||||
onVisibleChange={setIsShow}
|
||||
>
|
||||
<SelectorWrapper data-testid="current-workspace">
|
||||
<Avatar alt="Affine" src={currentWorkspace?.meta.avatar || ''} />
|
||||
<Avatar alt="Affine" src={currentWorkspace?.meta.avatar || ''}>
|
||||
<AffineIcon />
|
||||
</Avatar>
|
||||
<WorkspaceName>
|
||||
{currentWorkspace?.meta.name ||
|
||||
(workspaceMeta?.type === WorkspaceType.Private && user
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
export const AffineIcon = () => {
|
||||
return (
|
||||
<svg
|
||||
width="40"
|
||||
height="40"
|
||||
viewBox="0 0 40 40"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<rect
|
||||
x="0.5"
|
||||
y="0.5"
|
||||
width="39"
|
||||
height="39"
|
||||
rx="19.5"
|
||||
stroke="#6880FF"
|
||||
fill="#FFF"
|
||||
/>
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
clip-rule="evenodd"
|
||||
d="M18.6303 8.79688L11.2559 29.8393H15.5752L20.2661 15.2858L24.959 29.8393H29.2637L21.8881 8.79688H18.6303Z"
|
||||
fill="#6880FF"
|
||||
/>
|
||||
</svg>
|
||||
);
|
||||
};
|
||||
@@ -5,18 +5,10 @@ loadPage();
|
||||
|
||||
test.describe('Open contact us', () => {
|
||||
test('Click about us', async ({ page }) => {
|
||||
page.waitForTimeout(1000);
|
||||
const currentWorkspace = page.getByTestId('current-workspace');
|
||||
await currentWorkspace.click();
|
||||
|
||||
await page
|
||||
.getByRole('tooltip', {
|
||||
name: 'A AFFiNE Log in to sync with affine About AFFiNE',
|
||||
})
|
||||
.locator('div')
|
||||
.filter({ hasText: 'About AFFiNE' })
|
||||
.nth(2)
|
||||
.click();
|
||||
page.waitForTimeout(1000);
|
||||
await page.getByText('About AFFiNE').click();
|
||||
|
||||
const contactUsModal = page.locator(
|
||||
'[data-testid=contact-us-modal-content]'
|
||||
@@ -24,7 +16,6 @@ test.describe('Open contact us', () => {
|
||||
await expect(contactUsModal).toContainText('AFFiNE Community');
|
||||
});
|
||||
test('Click right-bottom corner contact icon', async ({ page }) => {
|
||||
page.waitForTimeout(1000);
|
||||
const faqIcon = page.locator('[data-testid=faq-icon]');
|
||||
const box = await faqIcon.boundingBox();
|
||||
await expect(box?.x).not.toBeUndefined();
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import { test, expect, type Page } from '@playwright/test';
|
||||
import { loadPage } from './libs/load-page';
|
||||
|
||||
loadPage();
|
||||
|
||||
test.describe('Login Flow', () => {
|
||||
test('Open Login Modal', async ({ page }) => {
|
||||
await page.getByTestId('current-workspace').click();
|
||||
await page.waitForTimeout(800);
|
||||
// why don't we use waitForSelector, It seems that waitForSelector not stable?
|
||||
await page.getByTestId('open-login-modal').click();
|
||||
await page.waitForTimeout(800);
|
||||
await page
|
||||
.getByRole('heading', { name: 'Currently not logged in' })
|
||||
.click();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user