-
Notifications
You must be signed in to change notification settings - Fork 538
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Case: One button in a title (private/public tag)
Fixes #1582
- Loading branch information
Showing
15 changed files
with
307 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
import { test, expect } from '@playwright/experimental-ct-react'; | ||
import React from 'react'; | ||
|
||
import TestApp from 'playwright/TestApp'; | ||
|
||
import AccountActionsMenu from './AccountActionsMenu'; | ||
|
||
test.use({ viewport: { width: 200, height: 200 } }); | ||
|
||
test.describe('with multiple items', async() => { | ||
const hooksConfig = { | ||
router: { | ||
query: { hash: '<hash>' }, | ||
pathname: '/token/[hash]', | ||
isReady: true, | ||
}, | ||
}; | ||
|
||
test('base view', async({ mount, page }) => { | ||
const component = await mount( | ||
<TestApp> | ||
<AccountActionsMenu/> | ||
</TestApp>, | ||
{ hooksConfig }, | ||
); | ||
|
||
await component.getByRole('button').click(); | ||
|
||
await expect(page).toHaveScreenshot(); | ||
}); | ||
|
||
test('base view with styles', async({ mount, page }) => { | ||
const component = await mount( | ||
<TestApp> | ||
<AccountActionsMenu m={ 2 } outline="1px solid lightpink"/> | ||
</TestApp>, | ||
{ hooksConfig }, | ||
); | ||
|
||
await component.getByRole('button').click(); | ||
|
||
await expect(page).toHaveScreenshot(); | ||
}); | ||
|
||
test('loading', async({ mount }) => { | ||
const component = await mount( | ||
<TestApp> | ||
<AccountActionsMenu isLoading/> | ||
</TestApp>, | ||
{ hooksConfig }, | ||
); | ||
|
||
await expect(component).toHaveScreenshot(); | ||
}); | ||
|
||
test('loading with styles', async({ mount }) => { | ||
const component = await mount( | ||
<TestApp> | ||
<AccountActionsMenu isLoading m={ 2 } outline="1px solid lightpink"/> | ||
</TestApp>, | ||
{ hooksConfig }, | ||
); | ||
|
||
await expect(component).toHaveScreenshot(); | ||
}); | ||
}); | ||
|
||
test.describe('with one item', async() => { | ||
const hooksConfig = { | ||
router: { | ||
query: { hash: '<hash>' }, | ||
pathname: '/tx/[hash]', | ||
isReady: true, | ||
}, | ||
}; | ||
|
||
test('base view', async({ mount, page }) => { | ||
const component = await mount( | ||
<TestApp> | ||
<AccountActionsMenu/> | ||
</TestApp>, | ||
{ hooksConfig }, | ||
); | ||
|
||
await component.getByRole('button').hover(); | ||
|
||
await expect(page).toHaveScreenshot(); | ||
}); | ||
|
||
test('base view with styles', async({ mount, page }) => { | ||
const component = await mount( | ||
<TestApp> | ||
<AccountActionsMenu m={ 2 } outline="1px solid lightpink"/> | ||
</TestApp>, | ||
{ hooksConfig }, | ||
); | ||
|
||
await component.getByRole('button').hover(); | ||
|
||
await expect(page).toHaveScreenshot(); | ||
}); | ||
|
||
test('loading', async({ mount }) => { | ||
const component = await mount( | ||
<TestApp> | ||
<AccountActionsMenu isLoading/> | ||
</TestApp>, | ||
{ hooksConfig }, | ||
); | ||
|
||
await expect(component).toHaveScreenshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+8.41 KB
...enshots__/AccountActionsMenu.pw.tsx_default_with-multiple-items-base-view-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+8.72 KB
...countActionsMenu.pw.tsx_default_with-multiple-items-base-view-with-styles-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+658 Bytes
...reenshots__/AccountActionsMenu.pw.tsx_default_with-multiple-items-loading-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+907 Bytes
...AccountActionsMenu.pw.tsx_default_with-multiple-items-loading-with-styles-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4 KB
...__screenshots__/AccountActionsMenu.pw.tsx_default_with-one-item-base-view-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.13 KB
...s__/AccountActionsMenu.pw.tsx_default_with-one-item-base-view-with-styles-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+658 Bytes
...u/__screenshots__/AccountActionsMenu.pw.tsx_default_with-one-item-loading-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.