-
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.
Oppgrader fra react 17 til 18, som medfølger: - Bytte fra enzyme til react-testing-library, og påfølgende endringer i API for test rendering. - Oppdatering av snapshots for endringer i react og styled-components rendering.
- Loading branch information
Showing
52 changed files
with
908 additions
and
1,528 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import * as React from 'react'; | ||
import * as ReactDOM from 'react-dom'; | ||
import { createRoot } from 'react-dom/client'; | ||
import AppContainer from './AppContainer'; | ||
|
||
it('renders without crashing', () => { | ||
const div = document.createElement('div'); | ||
div.id = 'root'; | ||
document.body.appendChild(div); | ||
|
||
ReactDOM.render(<AppContainer />, div); | ||
const root = createRoot(div) | ||
root.render(<AppContainer />); | ||
}); |
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,15 +1,15 @@ | ||
import * as React from 'react'; | ||
import { mount } from 'enzyme'; | ||
import { render } from '@testing-library/react'; | ||
|
||
import BrukerprofilSide from './BrukerprofilSide'; | ||
import TestProvider from '../../test/Testprovider'; | ||
|
||
test('Smoketeste brukerprofil', () => { | ||
const brukerprofil = mount( | ||
const { container } = render( | ||
<TestProvider> | ||
<BrukerprofilSide /> | ||
</TestProvider> | ||
); | ||
|
||
expect(brukerprofil).toMatchSnapshot(); | ||
expect(container).toMatchSnapshot(); | ||
}); |
84 changes: 83 additions & 1 deletion
84
src/app/brukerprofil/__snapshots__/BrukeprofilSide.test.tsx.snap
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,3 +1,85 @@ | ||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html | ||
|
||
exports[`Smoketeste brukerprofil 1`] = `ReactWrapper {}`; | ||
exports[`Smoketeste brukerprofil 1`] = ` | ||
.c0 { | ||
display: -webkit-box; | ||
display: -webkit-flex; | ||
display: -ms-flexbox; | ||
display: flex; | ||
-webkit-flex-direction: column; | ||
-ms-flex-direction: column; | ||
flex-direction: column; | ||
-webkit-box-pack: center; | ||
-webkit-justify-content: center; | ||
-ms-flex-pack: center; | ||
justify-content: center; | ||
-webkit-align-items: center; | ||
-webkit-box-align: center; | ||
-ms-flex-align: center; | ||
align-items: center; | ||
-webkit-box-flex: 1; | ||
-webkit-flex-grow: 1; | ||
-ms-flex-positive: 1; | ||
flex-grow: 1; | ||
} | ||
.c0 > *:first-child { | ||
margin-bottom: 1rem; | ||
} | ||
<div> | ||
<div | ||
class="c0" | ||
> | ||
<div | ||
class="alertstripe alertstripe--info" | ||
> | ||
<span | ||
class="alertstripe__ikon" | ||
> | ||
<span | ||
class="sr-only" | ||
> | ||
info | ||
</span> | ||
<svg | ||
aria-label="info-ikon" | ||
focusable="false" | ||
height="1.5em" | ||
kind="info-sirkel-fyll" | ||
role="img" | ||
viewBox="0 0 24 24" | ||
width="1.5em" | ||
> | ||
<g | ||
fill="none" | ||
> | ||
<path | ||
d="M12 0C5.382 0 0 5.382 0 12s5.382 12 12 12c6.617 0 12-5.382 12-12S18.617 0 12 0z" | ||
fill="#337C9B" | ||
/> | ||
<path | ||
d="M12 5a1.566 1.566 0 1 1 .11 3.13A1.566 1.566 0 0 1 12 5zm2.976 12.01c.563 0 1.043.431 1.043.991s-.48.992-1.043.992H9.39c-.564 0-1.043-.431-1.043-.992 0-.56.479-.99 1.043-.99h1.6v-5.016h-.986c-.565 0-1.044-.43-1.044-.991 0-.56.48-.991 1.044-.991h2.03c.563 0 1.043.43 1.043.99v6.007h1.899z" | ||
fill="#FFF" | ||
/> | ||
</g> | ||
</svg> | ||
</span> | ||
<div | ||
class="typo-normal alertstripe__tekst" | ||
> | ||
Redigering av brukerprofil er flyttet | ||
</div> | ||
</div> | ||
<a | ||
class="lenkepanel" | ||
href="" | ||
> | ||
Gå til den nye personforvalteren | ||
<span | ||
class="lenkepanel__indikator" | ||
/> | ||
</a> | ||
</div> | ||
</div> | ||
`; |
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
Oops, something went wrong.