-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Legg til funksjonalitet for å fjerne en person fra kontekst ved event
fra navigasjonsmenyen
- Loading branch information
Joakim Lindquister
committed
Mar 7, 2018
1 parent
766db86
commit 0dce895
Showing
9 changed files
with
62 additions
and
20 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 was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { parseUrlForPersonIKontekst } from './urlUtils'; | ||
import { paths } from '../routes/routing'; | ||
|
||
it('returnerer fødselsnummeret når en person er i kontekst i URL', () => { | ||
const location = { | ||
pathname: `${paths.personUri}/123` | ||
}; | ||
|
||
const fodselsnummer = parseUrlForPersonIKontekst(location); | ||
|
||
expect(fodselsnummer).toEqual('123'); | ||
}); | ||
|
||
it('returnerer tomt fødselsnummer når en person ikke er i kontekst', () => { | ||
const location = { | ||
pathname: '/' | ||
}; | ||
|
||
const fodselsnummer = parseUrlForPersonIKontekst(location); | ||
|
||
expect(fodselsnummer).toEqual(''); | ||
}); |
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,13 @@ | ||
import { paths } from '../routes/routing'; | ||
|
||
interface Location { | ||
pathname: string; | ||
} | ||
|
||
export function parseUrlForPersonIKontekst(location: Location): string { | ||
const splittetUrl = location.pathname.split(`${paths.personUri}/`); | ||
if (splittetUrl.length >= 2 && splittetUrl[1]) { | ||
return splittetUrl[1]; | ||
} | ||
return ''; | ||
} |
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 |
---|---|---|
|
@@ -33,7 +33,7 @@ | |
"no-arg": true, | ||
"no-bitwise": true, | ||
"no-console": [ | ||
true, | ||
false, | ||
"log", | ||
"error", | ||
"debug", | ||
|