-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add BRC-20 and SRC-20 to collectibles
- Loading branch information
1 parent
1a5fb85
commit 3360f0c
Showing
6 changed files
with
148 additions
and
22 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,23 @@ | ||
interface Asset { | ||
name: string; | ||
icon: string; | ||
} | ||
|
||
export function sortAssetsBySymbol(assets: Asset[]) { | ||
return assets | ||
.sort((a, b) => { | ||
if (a.name < b.name) return -1; | ||
if (a.name > b.name) return 1; | ||
return 0; | ||
}) | ||
.sort((a, b) => { | ||
if (a.name === 'STX') return -1; | ||
if (b.name !== 'STX') return 1; | ||
return 0; | ||
}) | ||
.sort((a, b) => { | ||
if (a.name === 'BTC') return -1; | ||
if (b.name !== 'BTC') return 1; | ||
return 0; | ||
}); | ||
} |
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
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,20 @@ | ||
import { test } from '../../fixtures/fixtures'; | ||
|
||
test.describe('Receive Dialog', () => { | ||
test.beforeAll(async ({ extensionId, globalPage, onboardingPage, homePage }) => { | ||
await globalPage.setupAndUseApiCalls(extensionId); | ||
await onboardingPage.signInExistingUser(); | ||
await homePage.goToReceiveDialog(); | ||
}); | ||
|
||
test('That the Receive dialog renders and shows the correct assets', async ({ homePage }) => { | ||
test.expect(homePage.page.getByText('CHOOSE ASSET TO RECEIVE')).toBeTruthy(); | ||
test.expect(homePage.page.getByText('Tokens')).toBeTruthy(); | ||
test.expect(homePage.page.getByText('Collectibles')).toBeTruthy(); | ||
|
||
test.expect(homePage.page.getByText('Bitcoin')).toBeTruthy(); | ||
test.expect(homePage.page.getByText('Stacks')).toBeTruthy(); | ||
test.expect(homePage.page.getByText('BRC-20')).toBeTruthy(); | ||
test.expect(homePage.page.getByText('SRC-20')).toBeTruthy(); | ||
}); | ||
}); |