This repository has been archived by the owner on Aug 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from radixdlt/develop
release 0.11.0
- Loading branch information
Showing
49 changed files
with
12,495 additions
and
1,425 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,32 @@ | ||
name: Playwright E2E Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
pull_request: | ||
branches: | ||
- main | ||
- develop | ||
jobs: | ||
test: | ||
timeout-minutes: 60 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
- name: Install dependencies | ||
run: yarn install --frozen-lockfile | ||
- name: Install Playwright Browsers | ||
run: npx playwright install --with-deps | ||
- name: Run Playwright tests | ||
run: npx playwright test | ||
- uses: actions/upload-artifact@v3 | ||
if: always() | ||
with: | ||
name: playwright-report | ||
path: playwright-report/ | ||
retention-days: 30 |
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 |
---|---|---|
|
@@ -3,6 +3,7 @@ on: | |
push: | ||
branches: | ||
- main | ||
- develop | ||
workflow_dispatch: | ||
|
||
jobs: | ||
|
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,11 @@ | ||
module.exports = { | ||
stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'], | ||
addons: ['@storybook/addon-links', '@storybook/addon-essentials'], | ||
framework: '@storybook/web-components', | ||
core: { | ||
builder: '@storybook/builder-vite', | ||
}, | ||
features: { | ||
storyStoreV7: true, | ||
}, | ||
} |
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,3 @@ | ||
<script> | ||
window.global = window | ||
</script> |
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,9 @@ | ||
export const parameters = { | ||
actions: { argTypesRegex: "^on[A-Z].*" }, | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/, | ||
}, | ||
}, | ||
} |
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 not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
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,7 @@ | ||
module.exports = { | ||
presets: [ | ||
['@babel/preset-env', { targets: { node: 'current' } }], | ||
'@babel/preset-typescript', | ||
'babel-preset-vite', | ||
], | ||
} |
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 @@ | ||
module.exports = { extends: ['@commitlint/config-conventional'] } |
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,54 @@ | ||
import { test, expect } from '@playwright/test' | ||
|
||
test.beforeEach(async ({ page }) => { | ||
await page.goto('/') | ||
}) | ||
|
||
test('renders "Connect" text by default', async ({ page }) => { | ||
await expect(page.getByText('Connect')).toBeVisible() | ||
}) | ||
|
||
test('toggles popover on button click', async ({ page }) => { | ||
page.locator('radix-connect-button').click() | ||
|
||
const popover = page.locator('radix-popover') | ||
|
||
await expect(popover.getByText('Connect your Radix Wallet')).toBeVisible() | ||
await expect(popover.getByText('Connect Now')).toBeVisible() | ||
|
||
page.locator('radix-connect-button').click() | ||
|
||
await expect(page.locator('radix-popover')).not.toBeVisible() | ||
}) | ||
|
||
test('renders indicator in loading state', async ({ page }) => { | ||
await page.evaluate(() => | ||
window.radixConnectButtonApi.setState({ loading: true }) | ||
) | ||
await expect(page.locator('loading-spinner')).toBeVisible() | ||
}) | ||
|
||
test('renders "Connected" text in connected state', async ({ page }) => { | ||
await page.evaluate(() => | ||
window.radixConnectButtonApi.setState({ connected: true }) | ||
) | ||
await expect(page.getByText('Connected')).toBeVisible() | ||
}) | ||
|
||
test('renders text & indicator in connected loading state', async ({ | ||
page, | ||
}) => { | ||
await page.evaluate(() => | ||
window.radixConnectButtonApi.setState({ connected: true, loading: true }) | ||
) | ||
await expect(page.locator('loading-spinner')).toBeVisible() | ||
await expect(page.getByText('Connected')).toBeVisible() | ||
}) | ||
|
||
test('saves most recent state to local storage', async ({ page }) => { | ||
await page.evaluate(() => | ||
window.radixConnectButtonApi.setState({ connected: true }) | ||
) | ||
const localStorage = await page.evaluate(() => window.localStorage) | ||
expect(localStorage['radixdlt.connected']).toBe('true') | ||
}) |
Oops, something went wrong.