-
Notifications
You must be signed in to change notification settings - Fork 464
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
91c4946
commit 600dc2f
Showing
13 changed files
with
64 additions
and
19 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
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,59 @@ | ||
import { test, expect } from '@playwright/experimental-ct-react'; | ||
import React from 'react'; | ||
|
||
import { txInterpretation } from 'mocks/txs/txInterpretation'; | ||
import contextWithEnvs from 'playwright/fixtures/contextWithEnvs'; | ||
import TestApp from 'playwright/TestApp'; | ||
import buildApiUrl from 'playwright/utils/buildApiUrl'; | ||
import * as configs from 'playwright/utils/configs'; | ||
|
||
import TxSubHeading from './TxSubHeading'; | ||
|
||
const hash = '0x62d597ebcf3e8d60096dd0363bc2f0f5e2df27ba1dacd696c51aa7c9409f3193'; | ||
|
||
const TX_INTERPRETATION_API_URL = buildApiUrl('tx_interpretation', { hash }); | ||
|
||
test('no interpretation +@mobile', async({ mount }) => { | ||
const component = await mount( | ||
<TestApp> | ||
<TxSubHeading hash={ hash } hasTag={ false }/> | ||
</TestApp>, | ||
); | ||
|
||
await expect(component).toHaveScreenshot(); | ||
}); | ||
|
||
const bsInterpretationTest = test.extend({ | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
context: contextWithEnvs(configs.featureEnvs.txInterpretation) as any, | ||
}); | ||
|
||
bsInterpretationTest('with interpretation +@mobile +@dark-mode', async({ mount, page }) => { | ||
await page.route(TX_INTERPRETATION_API_URL, (route) => route.fulfill({ | ||
status: 200, | ||
body: JSON.stringify(txInterpretation), | ||
})); | ||
|
||
const component = await mount( | ||
<TestApp> | ||
<TxSubHeading hash={ hash } hasTag={ false }/> | ||
</TestApp>, | ||
); | ||
|
||
await expect(component).toHaveScreenshot(); | ||
}); | ||
|
||
bsInterpretationTest('no interpretation', async({ mount, page }) => { | ||
await page.route(TX_INTERPRETATION_API_URL, (route) => route.fulfill({ | ||
status: 200, | ||
body: JSON.stringify({ data: { summaries: [] } }), | ||
})); | ||
|
||
const component = await mount( | ||
<TestApp> | ||
<TxSubHeading hash={ hash } hasTag={ false }/> | ||
</TestApp>, | ||
); | ||
|
||
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
+13.4 KB
.../TxSubHeading.pw.tsx_dark-color-mode_with-interpretation-mobile-dark-mode-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.81 KB
ui/tx/__screenshots__/TxSubHeading.pw.tsx_default_no-interpretation-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.81 KB
ui/tx/__screenshots__/TxSubHeading.pw.tsx_default_no-interpretation-mobile-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
+12.8 KB
...nshots__/TxSubHeading.pw.tsx_default_with-interpretation-mobile-dark-mode-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
+7.23 KB
ui/tx/__screenshots__/TxSubHeading.pw.tsx_mobile_no-interpretation-mobile-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
+12.7 KB
...enshots__/TxSubHeading.pw.tsx_mobile_with-interpretation-mobile-dark-mode-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 was deleted.
Oops, something went wrong.
Binary file removed
BIN
-9.17 KB
...hots__/TxInterpretation.pw.tsx_dark-color-mode_base-view-mobile-dark-mode-1.png
Binary file not shown.
Binary file removed
BIN
-8.93 KB
..._screenshots__/TxInterpretation.pw.tsx_default_base-view-mobile-dark-mode-1.png
Binary file not shown.
Binary file removed
BIN
-8.59 KB
...__screenshots__/TxInterpretation.pw.tsx_mobile_base-view-mobile-dark-mode-1.png
Binary file not shown.