-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Oppgrader nav-pakker #1095
Oppgrader nav-pakker #1095
Changes from 6 commits
594a2ca
43c0915
506bbb9
98421a6
08b82ce
b7b20b5
8e6c7b9
0acd2b2
428978b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
lint-staged | ||
npx lint-staged | ||
yarn run typecheck |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,9 +59,14 @@ describe('Datovelger', () => { | |
visFeilmeldinger: true, | ||
}); | ||
|
||
const { getAllByRole, container } = render( | ||
const { getAllByRole } = render( | ||
<TestProvidere> | ||
<Datovelger felt={current.fraOgMed} skjema={skjemaMock} label={'test-fra-og-med'} /> | ||
<Datovelger | ||
felt={current.fraOgMed} | ||
skjema={skjemaMock} | ||
label={'test-fra-og-med'} | ||
data-testid="test-fra-og-med" | ||
/> | ||
<Datovelger | ||
felt={current.tilOgMed} | ||
tilhørendeFraOgMedFelt={current.fraOgMed} | ||
|
@@ -71,11 +76,14 @@ describe('Datovelger', () => { | |
</TestProvidere> | ||
); | ||
|
||
const tilOgMedÅpneknapp = getAllByRole('button')[1]; | ||
const [, tilOgMedÅpneknapp] = getAllByRole('button'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Av nysgjerrighet: Hvordan funker denne måten å skrive det på/hva betyr det? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Dette er array destructuring, der jeg ser bort fra første (nullte) element. Det er mest digg når du skal lage konstanter ut fra flere elementer i et array, f.eks. Men det krever at det er lesbart for andre, da. Så om det ikke gir mening trenger vi ikke å gjøre det sånn Se MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment |
||
act(() => tilOgMedÅpneknapp.click()); | ||
const forrigeDag = container.querySelector('[aria-label="torsdag 9"]'); | ||
|
||
expect(forrigeDag?.getAttribute('disabled')).not.toBeNull(); | ||
const [tilOgMedKalender] = getAllByRole('dialog'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tidligere gikk vi ut fra at Skriver om til at vi henter ut til-og-med-kalenderen ved å se etter dialog-elementer som er tilgjengelige for brukeren (i dette caset er fra-og-med-kalenderen aria-hidden og treffer derfor ikke på |
||
|
||
const forrigeDag = tilOgMedKalender.querySelector('[aria-label="torsdag 9"]'); | ||
|
||
expect(forrigeDag).toBeDisabled(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Dette gir en bedre feilmelding:
Heller enn før:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🙌 |
||
}); | ||
|
||
it('kan avgrenses frem i tid', () => { | ||
|
@@ -114,6 +122,6 @@ describe('Datovelger', () => { | |
|
||
act(() => datovelgerÅpneKnapp.click()); | ||
const nesteDag = container.querySelector('[aria-label="lørdag 11"]'); | ||
expect(nesteDag?.getAttribute('disabled')).not.toBeNull(); | ||
expect(nesteDag).toBeDisabled(); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Det finnes en nyere versjon (3.3.1) enn dette også, skulle vi bare ha oppgradert dit med en gang?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ja, ser at det er den som ble installert også. Kan endre til det!