Skip to content

Commit e81b1c3

Browse files
committed
add test case for web3 wallet
1 parent 1d8cd9a commit e81b1c3

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

packages/ui/src/components/OrganizationSwitcher/__tests__/OrganizationSwitcher.test.tsx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,30 @@ describe('OrganizationSwitcher', () => {
113113
expect(queryByText('testuser')).not.toBeInTheDocument();
114114
});
115115

116+
it('does not show web3 wallet address in the personal workspace trigger', async () => {
117+
const { wrapper, props } = await createFixtures(f => {
118+
f.withOrganizations();
119+
f.withUser({
120+
email_addresses: ['test@clerk.com'],
121+
primary_web3_wallet_id: 'web3_wallet_123',
122+
web3_wallets: [
123+
{
124+
id: 'web3_wallet_123',
125+
object: 'web3_wallet',
126+
web3_wallet: '0x1234567890abcdef1234567890abcdef12345678',
127+
verification: { status: 'verified', strategy: 'web3_metamask_signature', attempts: 1, expire_at: null },
128+
},
129+
],
130+
});
131+
});
132+
133+
props.setProps({ hidePersonal: false });
134+
const { getByText, queryByText } = render(<OrganizationSwitcher />, { wrapper });
135+
expect(getByText('Personal account')).toBeInTheDocument();
136+
expect(queryByText('0x1234567890abcdef1234567890abcdef12345678')).not.toBeInTheDocument();
137+
expect(queryByText('0x1234')).not.toBeInTheDocument();
138+
});
139+
116140
it('shows "No organization selected" when user has no active organization and hidePersonal is true', async () => {
117141
const { wrapper, props } = await createFixtures(f => {
118142
f.withOrganizations();

0 commit comments

Comments
 (0)