-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: apply mono package updates #5944
Merged
+1,248
−1,079
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Large diffs are not rendered by default.
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
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
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
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); | ||
}); | ||
}); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are your thoughts on using a zod validator here to ensure the type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A schema validator could for example, filter the array for those that do not match, proving runtime safety
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do control data access here via our own library call
useStx20Tokens
, so we shouldn't really need any runtime type validation.The reason this was typed as a Partial in
@leather.io/query
was to accommodate the WIP model refactor that temporarily adds two unused fields toStx20CryptoAssetInfo
.To support that change we either needed to assert once like this or change every downstream file/component that handles
Stx20CryptoAssetInfo
to handle partials, which would have been a big increase in scope.