-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Naomi Aro
committed
Apr 16, 2021
1 parent
610608a
commit f3cc819
Showing
6 changed files
with
321 additions
and
39 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
24 changes: 16 additions & 8 deletions
24
app/tests/unit/containers/User/UserProfileDropdown.test.tsx
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 |
---|---|---|
@@ -1,19 +1,27 @@ | ||
import React from 'react'; | ||
import {shallow} from 'enzyme'; | ||
import {UserProfileDropdownComponent} from 'containers/User/UserProfileDropdown'; | ||
import {UserProfileDropdown_user} from '__generated__/UserProfileDropdown_user.graphql'; | ||
|
||
// https://github.com/facebook/relay/issues/2394#issuecomment-379590645 | ||
const mockRefType: any = null; | ||
const user = { | ||
firstName: 'Hamza', | ||
lastName: 'Javed', | ||
emailAddress: 'hamza@button.is', | ||
' $refType': mockRefType | ||
firstName: 'Test', | ||
lastName: 'Tester', | ||
emailAddress: 'really-long-email-to-see-wrapping@button.is', | ||
' $refType': 'UserProfileDropdown_user' | ||
}; | ||
let render; | ||
describe('UserProfileDropdown', () => { | ||
it('matches snapshot', () => { | ||
render = shallow(<UserProfileDropdownComponent user={user} />); | ||
it('matches mobile snapshot', () => { | ||
render = shallow( | ||
<UserProfileDropdownComponent user={user as UserProfileDropdown_user} /> | ||
); | ||
expect(render).toMatchSnapshot(); | ||
}); | ||
|
||
it('matches desktop snapshot', () => { | ||
render = shallow( | ||
<UserProfileDropdownComponent user={user as UserProfileDropdown_user} /> | ||
); | ||
expect(render).toMatchSnapshot(); | ||
}); | ||
}); |
Oops, something went wrong.