-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(judicial-system): Use "Varnaraðili" instead of "Sakborningur" e…
…verywhere (#6171) * Change Sakborningur to varnaraðili * Use Varnaradili in info card * Use Varnaradili in policeRequestAccordionItem * Use accused from core in requests table * Fix tests Co-authored-by: Ívar Oddsson <[email protected]> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
- Loading branch information
1 parent
ec500fe
commit 66cf7bc
Showing
9 changed files
with
142 additions
and
28 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
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 |
---|---|---|
|
@@ -2,11 +2,19 @@ import React from 'react' | |
import { render, screen } from '@testing-library/react' | ||
|
||
import InfoCard from './InfoCard' | ||
import { LocaleProvider } from '@island.is/localization' | ||
import { MockedProvider } from '@apollo/client/testing' | ||
|
||
describe('InfoCard', () => { | ||
test('should display the assigned defender name if that info is provided even though the defender email is not', async () => { | ||
// Arrange | ||
render(<InfoCard data={[]} defender={{ name: 'Joe' }} />) | ||
render( | ||
<MockedProvider> | ||
<LocaleProvider locale="is" messages={{}}> | ||
<InfoCard data={[]} defender={{ name: 'Joe' }} /> | ||
</LocaleProvider> | ||
</MockedProvider>, | ||
) | ||
|
||
// Act and Assert | ||
expect(await screen.findByText('Joe')).toBeTruthy() | ||
|
@@ -15,10 +23,14 @@ describe('InfoCard', () => { | |
test('should display the assigned defender name and phonenumber if that info is provided', async () => { | ||
// Arrange | ||
render( | ||
<InfoCard | ||
data={[]} | ||
defender={{ name: 'Joe', phoneNumber: '555-5555' }} | ||
/>, | ||
<MockedProvider> | ||
<LocaleProvider locale="is" messages={{}}> | ||
<InfoCard | ||
data={[]} | ||
defender={{ name: 'Joe', phoneNumber: '555-5555' }} | ||
/> | ||
</LocaleProvider> | ||
</MockedProvider>, | ||
) | ||
|
||
// Act and Assert | ||
|
@@ -28,10 +40,18 @@ describe('InfoCard', () => { | |
test('should display the assigned defender name, email and phonenumber if that info is provided', async () => { | ||
// Arrange | ||
render( | ||
<InfoCard | ||
data={[]} | ||
defender={{ name: 'Joe', email: '[email protected]', phoneNumber: '455-5544' }} | ||
/>, | ||
<MockedProvider> | ||
<LocaleProvider locale="is" messages={{}}> | ||
<InfoCard | ||
data={[]} | ||
defender={{ | ||
name: 'Joe', | ||
email: '[email protected]', | ||
phoneNumber: '455-5544', | ||
}} | ||
/> | ||
</LocaleProvider> | ||
</MockedProvider>, | ||
) | ||
|
||
// Act and Assert | ||
|
@@ -40,7 +60,13 @@ describe('InfoCard', () => { | |
|
||
test('should display a message saying that a defender has not been set if the defender info is missing', async () => { | ||
// Arrange | ||
render(<InfoCard data={[]} />) | ||
render( | ||
<MockedProvider> | ||
<LocaleProvider locale="is" messages={{}}> | ||
<InfoCard data={[]} /> | ||
</LocaleProvider> | ||
</MockedProvider>, | ||
) | ||
|
||
// Act and Assert | ||
expect(await screen.findByText('Hefur ekki verið skráður')).toBeTruthy() | ||
|
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