Skip to content

Commit 1198fb9

Browse files
authored
Merge pull request #106 from samuel-gomez/feature/update-deps-20240202
Feature/update deps 20240202
2 parents d505471 + e45fdb1 commit 1198fb9

File tree

147 files changed

+2004
-1523
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+2004
-1523
lines changed

package-lock.json

Lines changed: 1189 additions & 1056 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -27,68 +27,68 @@
2727
"@axa-fr/react-oidc": "7.12.12",
2828
"@axa-fr/react-toolkit-all": "2.2.0",
2929
"@axa-fr/react-toolkit-core": "2.2.0",
30-
"@tanstack/react-query": "5.10.0",
31-
"@tanstack/react-query-devtools": "5.12.0",
30+
"@tanstack/react-query": "5.17.15",
31+
"@tanstack/react-query-devtools": "5.17.15",
3232
"@uiw/react-textarea-code-editor": "3.0.2",
33-
"axe-core": "4.8.2",
33+
"axe-core": "4.8.3",
3434
"cross-fetch": "4.0.0",
3535
"downloadjs": "1.4.7",
36-
"github-markdown-css": "5.4.0",
36+
"github-markdown-css": "5.5.0",
3737
"lodash": "4.17.21",
38-
"prism-react-renderer": "2.3.0",
38+
"prism-react-renderer": "2.3.1",
3939
"react": "18.2.0",
4040
"react-dom": "18.2.0",
4141
"react-draggable": "4.4.6",
42-
"react-hook-form": "7.48.2",
42+
"react-hook-form": "7.49.3",
4343
"react-live": "4.1.5",
4444
"react-markdown": "9.0.1",
45-
"react-router-dom": "6.20.0",
45+
"react-router-dom": "6.21.2",
4646
"rehype-slug": "6.0.0",
4747
"remark-gfm": "4.0.0"
4848
},
4949
"devDependencies": {
50-
"@commitlint/cli": "18.4.3",
51-
"@commitlint/config-conventional": "18.4.3",
52-
"@testing-library/jest-dom": "6.1.5",
50+
"@commitlint/cli": "18.4.4",
51+
"@commitlint/config-conventional": "18.4.4",
52+
"@testing-library/jest-dom": "6.2.0",
5353
"@testing-library/react": "14.1.2",
5454
"@testing-library/react-hooks": "8.0.1",
55-
"@testing-library/user-event": "14.5.1",
55+
"@testing-library/user-event": "14.5.2",
5656
"@types/downloadjs": "1.4.6",
5757
"@types/jest-axe": "3.5.9",
5858
"@types/lodash": "4.14.202",
5959
"@types/node": "20.11.5",
60-
"@types/react": "18.2.39",
61-
"@types/react-dom": "18.2.17",
62-
"@typescript-eslint/eslint-plugin": "6.13.1",
63-
"@typescript-eslint/parser": "6.13.1",
64-
"@vitejs/plugin-react": "4.2.0",
65-
"@vitest/coverage-v8": "0.34.6",
60+
"@types/react": "18.2.48",
61+
"@types/react-dom": "18.2.18",
62+
"@typescript-eslint/eslint-plugin": "6.19.0",
63+
"@typescript-eslint/parser": "6.19.0",
64+
"@vitejs/plugin-react": "4.2.1",
65+
"@vitest/coverage-v8": "1.2.0",
6666
"cz-conventional-changelog": "3.3.0",
67-
"eslint": "8.54.0",
67+
"eslint": "8.56.0",
6868
"eslint-config-airbnb": "19.0.4",
6969
"eslint-config-airbnb-typescript": "17.1.0",
70-
"eslint-config-prettier": "9.0.0",
71-
"eslint-plugin-import": "2.29.0",
70+
"eslint-config-prettier": "9.1.0",
71+
"eslint-plugin-import": "2.29.1",
7272
"eslint-plugin-jsx-a11y": "6.8.0",
73-
"eslint-plugin-prettier": "5.0.1",
73+
"eslint-plugin-prettier": "5.1.3",
7474
"eslint-plugin-react": "7.33.2",
7575
"eslint-plugin-react-hooks": "4.6.0",
7676
"husky": "8.0.3",
7777
"jest-axe": "8.0.0",
7878
"jest-cucumber": "3.0.1",
79-
"jsdom": "23.0.1",
80-
"lint-staged": "15.1.0",
81-
"msw": "2.0.9",
82-
"prettier": "3.1.0",
83-
"rollup-plugin-visualizer": "5.9.3",
84-
"sass": "1.69.5",
79+
"jsdom": "23.2.0",
80+
"lint-staged": "15.2.0",
81+
"msw": "2.1.2",
82+
"prettier": "3.2.4",
83+
"rollup-plugin-visualizer": "5.12.0",
84+
"sass": "1.69.7",
8585
"serve": "14.2.1",
86-
"typescript": "5.3.2",
87-
"vite": "4.5.0",
88-
"vite-tsconfig-paths": "4.2.1",
89-
"vitest": "0.34.6",
90-
"vitest-sonar-reporter": "0.5.0",
91-
"whatwg-fetch": "3.6.19"
86+
"typescript": "5.3.3",
87+
"vite": "5.0.11",
88+
"vite-tsconfig-paths": "4.3.1",
89+
"vitest": "1.2.0",
90+
"vitest-sonar-reporter": "1.0.0",
91+
"whatwg-fetch": "3.6.20"
9292
},
9393
"config": {
9494
"commitizen": {

public/environment.development.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"base": "https://react-starter-api.vercel.app/api/",
44
"github": "https://raw.githubusercontent.com/"
55
},
6-
"baseUrl": "",
76
"fetchConfig": {
87
"headers": {
98
"Content-type": "application/json; charset=UTF-8"

scripts/files/package.json

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -23,60 +23,59 @@
2323
},
2424
"dependencies": {
2525
"@axa-fr/react-oidc": "7.12.12",
26-
"@axa-fr/react-toolkit-all": "2.1.0",
27-
"@axa-fr/react-toolkit-core": "2.1.0",
28-
"@popperjs/core": "2.11.8",
29-
"@tanstack/react-query": "5.10.0",
30-
"@tanstack/react-query-devtools": "5.12.0",
26+
"@axa-fr/react-toolkit-all": "2.2.0",
27+
"@axa-fr/react-toolkit-core": "2.2.0",
28+
"@tanstack/react-query": "5.17.15",
29+
"@tanstack/react-query-devtools": "5.17.15",
3130
"cross-fetch": "4.0.0",
3231
"lodash": "4.17.21",
3332
"react": "18.2.0",
3433
"react-dom": "18.2.0",
35-
"react-hook-form": "7.48.2",
36-
"react-router-dom": "6.20.0"
34+
"react-hook-form": "7.49.3",
35+
"react-router-dom": "6.21.2"
3736
},
3837
"devDependencies": {
39-
"@commitlint/cli": "18.4.3",
40-
"@commitlint/config-conventional": "18.4.3",
41-
"@testing-library/jest-dom": "6.1.5",
38+
"@commitlint/cli": "18.4.4",
39+
"@commitlint/config-conventional": "18.4.4",
40+
"@testing-library/jest-dom": "6.2.0",
4241
"@testing-library/react": "14.1.2",
4342
"@testing-library/react-hooks": "8.0.1",
44-
"@testing-library/user-event": "14.5.1",
43+
"@testing-library/user-event": "14.5.2",
4544
"@types/jest-axe": "3.5.9",
4645
"@types/lodash": "4.14.202",
4746
"@types/node": "20.11.5",
48-
"@types/react": "18.2.39",
49-
"@types/react-dom": "18.2.17",
50-
"@typescript-eslint/eslint-plugin": "6.13.1",
51-
"@typescript-eslint/parser": "6.13.1",
52-
"@vitejs/plugin-react": "4.2.0",
53-
"@vitest/coverage-v8": "0.34.6",
47+
"@types/react": "18.2.48",
48+
"@types/react-dom": "18.2.18",
49+
"@typescript-eslint/eslint-plugin": "6.19.0",
50+
"@typescript-eslint/parser": "6.19.0",
51+
"@vitejs/plugin-react": "4.2.1",
52+
"@vitest/coverage-v8": "1.2.0",
5453
"cz-conventional-changelog": "3.3.0",
55-
"eslint": "8.54.0",
54+
"eslint": "8.56.0",
5655
"eslint-config-airbnb": "19.0.4",
5756
"eslint-config-airbnb-typescript": "17.1.0",
58-
"eslint-config-prettier": "9.0.0",
59-
"eslint-plugin-import": "2.29.0",
57+
"eslint-config-prettier": "9.1.0",
58+
"eslint-plugin-import": "2.29.1",
6059
"eslint-plugin-jsx-a11y": "6.8.0",
61-
"eslint-plugin-prettier": "5.0.1",
60+
"eslint-plugin-prettier": "5.1.3",
6261
"eslint-plugin-react": "7.33.2",
6362
"eslint-plugin-react-hooks": "4.6.0",
6463
"husky": "8.0.3",
6564
"jest-axe": "8.0.0",
6665
"jest-cucumber": "3.0.1",
67-
"jsdom": "23.0.1",
68-
"lint-staged": "15.1.0",
69-
"msw": "2.0.9",
70-
"prettier": "3.1.0",
71-
"rollup-plugin-visualizer": "5.9.3",
72-
"sass": "1.69.5",
66+
"jsdom": "23.2.0",
67+
"lint-staged": "15.2.0",
68+
"msw": "2.1.2",
69+
"prettier": "3.2.4",
70+
"rollup-plugin-visualizer": "5.12.0",
71+
"sass": "1.69.7",
7372
"serve": "14.2.1",
74-
"typescript": "5.3.2",
75-
"vite": "4.5.0",
76-
"vite-tsconfig-paths": "4.2.1",
77-
"vitest": "0.34.6",
78-
"vitest-sonar-reporter": "0.5.0",
79-
"whatwg-fetch": "3.6.19"
73+
"typescript": "5.3.3",
74+
"vite": "5.0.11",
75+
"vite-tsconfig-paths": "4.3.1",
76+
"vitest": "1.2.0",
77+
"vitest-sonar-reporter": "1.0.0",
78+
"whatwg-fetch": "3.6.20"
8079
},
8180
"config": {
8281
"commitizen": {

scripts/files/src/pages/Home/Home.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import Layout, { TLayoutPage } from 'Layout';
2-
import { TITLE_BAR, TITLE } from './constants';
2+
import { TITLE, TITLE_BAR } from './constants';
33

44
export type THome = TLayoutPage;
55

66
const Home = ({ titleBar = TITLE_BAR, title = TITLE }: THome) => (
77
<Layout propsTitle={{ title: titleBar }}>
8-
<h1 className="af-title--content">{title}</h1>
8+
<h2 className="af-title--content">{title}</h2>
99
</Layout>
1010
);
1111

scripts/files/src/pages/Home/__tests__/Home.spec.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import { configure, screen } from '@testing-library/react';
12
import { defineFeature, loadFeature } from 'jest-cucumber';
2-
import { screen, configure } from '@testing-library/react';
33
import { render } from 'shared/testsUtils/customRender';
44
import { JeSuisUnUtilisateurConnuEtConnecteAvecleProfil, UnTitreEstVisible } from 'shared/testsUtils/sharedScenarios';
55
import Home from '../Home';
@@ -23,6 +23,6 @@ defineFeature(feature, test => {
2323
test("Affichage de la page d'accueil", ({ given, when, then }) => {
2424
JeSuisUnUtilisateurConnuEtConnecteAvecleProfil(given, setRoleMock);
2525
when("J'accède à la page accueil", renderPage);
26-
UnTitreEstVisible(then);
26+
UnTitreEstVisible(then, 2);
2727
});
2828
});
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { ReactNode, useContext } from 'react';
21
import { OidcProvider } from '@axa-fr/react-oidc';
32
import { EnvironmentContext } from 'App/EnvironmentProvider';
3+
import { ReactNode, useContext } from 'react';
44

5-
const Authentication = ({ children }: { children: ReactNode }) => {
5+
const Authentication = ({ children, OidcProviderCmpt = OidcProvider }: { children: ReactNode; OidcProviderCmpt?: typeof OidcProvider }) => {
66
const { environment } = useContext(EnvironmentContext);
77

8-
return environment?.oidc?.isEnabled ? <OidcProvider configuration={environment?.oidc}>{children}</OidcProvider> : <>{children}</>;
8+
return environment?.oidc?.isEnabled ? <OidcProviderCmpt configuration={environment?.oidc}>{children}</OidcProviderCmpt> : <>{children}</>;
99
};
1010

1111
export default Authentication;
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import { render, screen } from '@testing-library/react';
2+
import EnvironmentProvider from 'App/EnvironmentProvider';
3+
import { ReactNode } from 'react';
4+
import Authentication from '../Authentication';
5+
6+
const setOidc = (isEnabled = true) => ({
7+
envState: {
8+
environment: {
9+
apiUrl: '/',
10+
fetchConfig: {},
11+
oidc: {
12+
isEnabled,
13+
},
14+
},
15+
},
16+
});
17+
18+
const OidcProviderCmpt = ({ children }: { children: ReactNode }) => <div>with OIDC provider {children} </div>;
19+
20+
const renderAuthentication = (isEnabled = true) => {
21+
const useEnvFn = vi.fn().mockReturnValueOnce(setOidc(isEnabled));
22+
23+
render(
24+
<EnvironmentProvider useEnvFn={useEnvFn}>
25+
<Authentication OidcProviderCmpt={OidcProviderCmpt}>
26+
<p>my child</p>
27+
</Authentication>
28+
</EnvironmentProvider>,
29+
);
30+
};
31+
32+
describe('Authentication', () => {
33+
it('Should render Authentication with OidcProvider when oidc is enabled', () => {
34+
renderAuthentication();
35+
36+
expect(screen.getByText('with OIDC provider')).toBeDefined();
37+
expect(screen.getByText('my child')).toBeDefined();
38+
});
39+
40+
it('Should render Authentication without OidcProvider when oidc is not enabled', () => {
41+
renderAuthentication(false);
42+
43+
expect(screen.queryByText('with OIDC provider')).toBeNull();
44+
expect(screen.getByText('my child')).toBeDefined();
45+
});
46+
});

0 commit comments

Comments
 (0)