-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add bns v2 names integration test
- Loading branch information
1 parent
aadbbd3
commit c441be8
Showing
9 changed files
with
73 additions
and
5 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
File renamed without changes.
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
File renamed without changes.
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
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 @@ | ||
export function getSwitchAccountSheetAccountNameSelector(index: number) { | ||
return AccountSelectors.SwitchAccountSheetAccountName.replace('{index}', index.toString()); | ||
} | ||
|
||
export const AccountSelectors = { | ||
SwitchAccountSheetAccountName: 'switch-account-sheet-account-name-{index}', | ||
}; |
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,28 @@ | ||
import { mockBnsV2NamesRequest } from '@tests/mocks/mock-stacks-bns'; | ||
import { getSwitchAccountSheetAccountNameSelector } from '@tests/selectors/account.selectors'; | ||
import { SettingsSelectors } from '@tests/selectors/settings.selectors'; | ||
|
||
import { test } from '../../fixtures/fixtures'; | ||
|
||
const ACCOUNT_ONE_NAME = 'leather.btc'; | ||
|
||
test.describe('Bns v2 names', () => { | ||
test.beforeEach(async ({ extensionId, globalPage, onboardingPage }) => { | ||
await globalPage.setupAndUseApiCalls(extensionId); | ||
await mockBnsV2NamesRequest(globalPage.page); | ||
await onboardingPage.signInWithTestAccount(extensionId); | ||
}); | ||
|
||
test('that correctly shows bns v2 account name', async ({ page }) => { | ||
const accountName = page.getByTestId(SettingsSelectors.CurrentAccountDisplayName); | ||
|
||
const accountNameText = await accountName.innerText(); | ||
test.expect(accountNameText).toEqual(ACCOUNT_ONE_NAME); | ||
await accountName.click(); | ||
|
||
const accountOneName = page.getByTestId(getSwitchAccountSheetAccountNameSelector(0)); | ||
const accountOneNameText = await accountOneName.innerText(); | ||
|
||
test.expect(accountOneNameText).toEqual(ACCOUNT_ONE_NAME); | ||
}); | ||
}); |