Skip to content

Commit

Permalink
PLT-9600 #comment test:show wallet address
Browse files Browse the repository at this point in the history
  • Loading branch information
KJES4 committed Mar 27, 2024
1 parent cf2b732 commit 9d88cfc
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 38 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -2,7 +2,7 @@

| Statements | Branches | Functions | Lines |
| --------------------------- | ----------------------- | ------------------------- | ----------------- |
| ![Statements](https://img.shields.io/badge/statements-4.92%25-red.svg?style=flat) | ![Branches](https://img.shields.io/badge/branches-1.12%25-red.svg?style=flat) | ![Functions](https://img.shields.io/badge/functions-3.23%25-red.svg?style=flat) | ![Lines](https://img.shields.io/badge/lines-4.47%25-red.svg?style=flat) |
| ![Statements](https://img.shields.io/badge/statements-6.38%25-red.svg?style=flat) | ![Branches](https://img.shields.io/badge/branches-1.42%25-red.svg?style=flat) | ![Functions](https://img.shields.io/badge/functions-4.45%25-red.svg?style=flat) | ![Lines](https://img.shields.io/badge/lines-6.07%25-red.svg?style=flat) |

Front-end repository for Certification Service integration

Expand Down
75 changes: 38 additions & 37 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Expand Up @@ -68,6 +68,7 @@
]
},
"devDependencies": {
"@babel/preset-typescript": "^7.24.1",
"@testing-library/jest-dom": "^6.3.0",
"@testing-library/react": "^14.1.2",
"@testing-library/user-event": "^14.5.1",
Expand Down
66 changes: 66 additions & 0 deletions src/pages/session/components/AppBar.test.tsx
@@ -0,0 +1,66 @@
import React from 'react';
import { screen } from '@testing-library/react';
import '@testing-library/jest-dom';

import { renderWithProviders } from 'utils/test-utils';
import AppBar from './AppBar';

jest.mock('minidenticons', () => ({
minidenticon: jest.fn(() => 'mocked-svg')
}));

describe('App bar > logged in state', () => {
test('should render wallet address when logged in', async () => {
const preloadedState = {
walletConnection: {
wallet: null,
walletName: null,
walletAddress: 'addr...1234',
stakeAddress: null,
activeWallets: ['lace', 'nami', 'yoroi'],
errorMessage: null,
errorRetry: false,
loading: false,
listeningWalletChanges: false,
resetWalletChanges: false,
},
profile: {
profile: {
address: 'addr1234',
email: 'email@gmail.com',
fullName: 'name',
companyName: 'company',
contactEmail: 'contactemail@gmail.com',
linkedin: null,
twitter: null,
website: null,
role: null,
dapp: null,
},
errorMessage: null,
loading: false,
success: true,
selectedUser: null,
allUsers: null,
loadingDetails: false,
detailsSuccess: false,
detailsError: null,
userSubscription: null,
loadingSubDetails: false,
subDetailsSuccess: false,
subDetailsError: null,
updateSuccess: false,
loadingHistory: false,
runHistory: [],
impersonate: false,
retainId: null
}
};

renderWithProviders(<AppBar />, { preloadedState });

const walletAddress = await screen.findByText('addr...1234');

expect(walletAddress).toBeInTheDocument();
});
});

0 comments on commit 9d88cfc

Please sign in to comment.