-
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
Showing
3 changed files
with
36 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { AppHeader } from 'components/AppHeader/AppHeader'; | ||
import { render, screen } from 'setUpTest'; | ||
|
||
describe('AppHeader', () => { | ||
test('har overskrift på nivå h1', () => { | ||
render(<AppHeader />); | ||
expect(screen.getByRole('heading', { level: 1, name: 'Mine arbeidsavklaringspenger' })).toBeVisible(); | ||
}); | ||
}); |
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,27 @@ | ||
import { formatDate, formatFullDate } from 'lib/utils/date'; | ||
|
||
describe('date', () => { | ||
describe('formatFullDate', () => { | ||
test('returnerer tom streng når dato er undefined', () => { | ||
const resultat = formatFullDate(undefined); | ||
expect(resultat).toBe(''); | ||
}); | ||
|
||
test('returnerer dato på format dd.MM.yyyy HH:mm', () => { | ||
const resultat = formatFullDate('2023-08-10T12:32'); | ||
expect(resultat).toBe('10.08.2023 12:32'); | ||
}); | ||
}); | ||
|
||
describe('formatDate', () => { | ||
test('returnerer tom streng når dato er undefined', () => { | ||
const resultat = formatDate(undefined); | ||
expect(resultat).toBe(''); | ||
}); | ||
|
||
test('returnerer format på d. MMMM yyyy', () => { | ||
const resultat = formatDate('2023-08-10T12:32'); | ||
expect(resultat).toBe('10. august 2023'); | ||
}); | ||
}); | ||
}); |
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,6 +1,5 @@ | ||
/// <reference types="next" /> | ||
/// <reference types="next/image-types/global" /> | ||
/// <reference types="next/navigation-types/compat/navigation" /> | ||
|
||
// NOTE: This file should not be edited | ||
// see https://nextjs.org/docs/basic-features/typescript for more information. |