richie-education 2.25.0-b2.dev164 → 2.25.0-b2.dev168

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,17 +1,16 @@
1
+ import { dirname, join } from "path";
2
+
1
3
  const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
2
4
  module.exports = {
3
- stories: [
4
- '../stories/**/*.stories.mdx',
5
- '../stories/**/*.stories.@(js|jsx|ts|tsx)',
6
- '../js/**/*.stories.@(js|jsx|ts|tsx)'
7
- ],
5
+ stories: ['../stories/**/*.mdx', '../stories/**/*.stories.@(js|jsx|ts|tsx)', '../js/**/*.stories.@(js|jsx|ts|tsx)'],
8
6
  addons: [
9
- '@storybook/addon-links',
10
- '@storybook/addon-essentials',
11
- '@storybook/addon-interactions'
7
+ getAbsolutePath('@storybook/addon-links'),
8
+ getAbsolutePath('@storybook/addon-essentials'),
9
+ getAbsolutePath('@storybook/addon-interactions'),
10
+ getAbsolutePath('@storybook/addon-webpack5-compiler-babel'),
12
11
  ],
13
12
  framework: {
14
- name: '@storybook/react-webpack5',
13
+ name: getAbsolutePath('@storybook/react-webpack5'),
15
14
  options: {},
16
15
  },
17
16
  staticDirs: [{
@@ -31,6 +30,10 @@ module.exports = {
31
30
  return config;
32
31
  },
33
32
  docs: {
34
- autodocs: true,
33
+ autodocs: false,
35
34
  },
36
35
  };
36
+
37
+ function getAbsolutePath(value) {
38
+ return dirname(require.resolve(join(value, "package.json")));
39
+ }
@@ -1,17 +1,20 @@
1
1
  import { useState } from 'react';
2
2
  import { IntlProvider } from 'react-intl';
3
3
  import { CunninghamProvider } from '@openfun/cunningham-react';
4
+ import { Preview } from '@storybook/react';
4
5
  import { useAsyncEffect } from 'hooks/useAsyncEffect';
5
6
  import './__mocks__/utils/context';
6
7
 
7
- export const parameters = {
8
- actions: { argTypesRegex: '^on[A-Z].*' },
9
- controls: {
10
- matchers: {
11
- color: /(background|color)$/i,
12
- date: /Date$/,
8
+ export const preview: Preview = {
9
+ parameters: {
10
+ actions: { argTypesRegex: '^on[A-Z].*' },
11
+ controls: {
12
+ matchers: {
13
+ color: /(background|color)$/i,
14
+ date: /Date$/,
15
+ },
13
16
  },
14
- },
17
+ }
15
18
  };
16
19
 
17
20
  const IconsWrapper = (props) => {
@@ -159,7 +159,10 @@ describe.each([
159
159
  });
160
160
 
161
161
  afterEach(() => {
162
- jest.runOnlyPendingTimers();
162
+ act(() => {
163
+ jest.runOnlyPendingTimers();
164
+ });
165
+
163
166
  jest.useRealTimers();
164
167
  cleanup();
165
168
  });
@@ -787,9 +790,17 @@ describe.each([
787
790
  screen.getByText('Payment in progress');
788
791
 
789
792
  fetchMock.resetHistory();
793
+
790
794
  // - Wait until order has been polled 29 times.
791
- await jest.advanceTimersToNextTimerAsync(PAYMENT_SETTINGS.pollLimit);
792
- expect(fetchMock.calls()).toHaveLength(PAYMENT_SETTINGS.pollLimit - 1);
795
+ await act(async () => {
796
+ await jest.advanceTimersByTimeAsync(
797
+ (PAYMENT_SETTINGS.pollLimit - 1) * PAYMENT_SETTINGS.pollInterval,
798
+ );
799
+ });
800
+
801
+ await waitFor(async () => {
802
+ expect(fetchMock.calls()).toHaveLength(PAYMENT_SETTINGS.pollLimit - 1);
803
+ });
793
804
 
794
805
  // - This round should be the last after which the order should be aborted
795
806
  await act(async () => {
@@ -1,9 +1,9 @@
1
1
  import { fireEvent, render, screen, within } from '@testing-library/react';
2
2
  import { IntlProvider } from 'react-intl';
3
- import { userEvent } from '@storybook/testing-library';
4
3
  import { PropsWithChildren, useMemo, useState } from 'react';
5
4
  import { QueryClientProvider } from '@tanstack/react-query';
6
5
  import { CunninghamProvider } from '@openfun/cunningham-react';
6
+ import userEvent from '@testing-library/user-event';
7
7
  import { Priority } from 'types';
8
8
  import {
9
9
  CourseRun,
@@ -1,5 +1,6 @@
1
1
  import {
2
2
  act,
3
+ findByText,
3
4
  fireEvent,
4
5
  getByRole,
5
6
  queryByRole,
@@ -10,7 +11,6 @@ import {
10
11
  import { IntlProvider } from 'react-intl';
11
12
  import { QueryClientProvider } from '@tanstack/react-query';
12
13
  import fetchMock from 'fetch-mock';
13
- import { findByText } from '@storybook/testing-library';
14
14
  import { RichieContextFactory as mockRichieContextFactory } from 'utils/test/factories/richie';
15
15
  import { AddressFactory } from 'utils/test/factories/joanie';
16
16
  import { SessionProvider } from 'contexts/SessionContext';
@@ -11,7 +11,7 @@ import {
11
11
  } from '@testing-library/react';
12
12
  import { faker } from '@faker-js/faker';
13
13
  import fetchMock from 'fetch-mock';
14
- import { userEvent } from '@storybook/testing-library';
14
+ import userEvent from '@testing-library/user-event';
15
15
  import { DEFAULT_DATE_FORMAT } from 'hooks/useDateFormat';
16
16
  import {
17
17
  CourseStateFactory,
@@ -1,6 +1,6 @@
1
1
  import { screen } from '@testing-library/react';
2
- import { userEvent } from '@storybook/testing-library';
3
2
  import { PropsWithChildren } from 'react';
3
+ import userEvent from '@testing-library/user-event';
4
4
  import { render } from 'utils/test/render';
5
5
  import { IntlWrapper } from 'utils/test/wrappers/IntlWrapper';
6
6
  import { DashboardSubItemsList } from './DashboardSubItemsList';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "richie-education",
3
- "version": "2.25.0-b2.dev164",
3
+ "version": "2.25.0-b2.dev168",
4
4
  "description": "A CMS to build learning portals for Open Education",
5
5
  "main": "sandbox/manage.py",
6
6
  "scripts": {
@@ -38,34 +38,34 @@
38
38
  "not dead"
39
39
  ],
40
40
  "dependencies": {
41
- "@babel/core": "7.24.0",
41
+ "@babel/core": "7.24.3",
42
42
  "@babel/plugin-syntax-dynamic-import": "7.8.3",
43
- "@babel/plugin-transform-modules-commonjs": "7.23.3",
44
- "@babel/preset-env": "7.24.0",
45
- "@babel/preset-react": "7.23.3",
46
- "@babel/preset-typescript": "7.23.3",
43
+ "@babel/plugin-transform-modules-commonjs": "7.24.1",
44
+ "@babel/preset-env": "7.24.3",
45
+ "@babel/preset-react": "7.24.1",
46
+ "@babel/preset-typescript": "7.24.1",
47
47
  "@faker-js/faker": "8.4.1",
48
- "@formatjs/cli": "6.2.7",
48
+ "@formatjs/cli": "6.2.8",
49
49
  "@formatjs/intl-relativetimeformat": "11.2.12",
50
50
  "@hookform/resolvers": "3.3.4",
51
51
  "@openfun/cunningham-react": "2.6.0",
52
52
  "@openfun/cunningham-tokens": "2.1.1",
53
- "@sentry/browser": "7.106.0",
54
- "@sentry/types": "7.106.0",
55
- "@storybook/addon-actions": "7.6.17",
56
- "@storybook/addon-essentials": "7.6.17",
57
- "@storybook/addon-interactions": "7.6.17",
58
- "@storybook/addon-links": "7.6.17",
59
- "@storybook/react": "7.6.17",
60
- "@storybook/react-webpack5": "7.6.17",
61
- "@storybook/testing-library": "0.2.2",
62
- "@tanstack/query-core": "5.25.0",
63
- "@tanstack/query-sync-storage-persister": "5.25.0",
64
- "@tanstack/react-query": "5.25.0",
65
- "@tanstack/react-query-persist-client": "5.25.0",
53
+ "@sentry/browser": "7.108.0",
54
+ "@sentry/types": "7.108.0",
55
+ "@storybook/addon-actions": "8.0.4",
56
+ "@storybook/addon-essentials": "8.0.4",
57
+ "@storybook/addon-interactions": "8.0.4",
58
+ "@storybook/addon-links": "8.0.4",
59
+ "@storybook/react": "8.0.4",
60
+ "@storybook/react-webpack5": "8.0.4",
61
+ "@storybook/test": "8.0.4",
62
+ "@tanstack/query-core": "5.28.8",
63
+ "@tanstack/query-sync-storage-persister": "5.28.8",
64
+ "@tanstack/react-query": "5.28.8",
65
+ "@tanstack/react-query-persist-client": "5.28.8",
66
66
  "@testing-library/dom": "9.3.4",
67
67
  "@testing-library/jest-dom": "6.4.2",
68
- "@testing-library/react": "14.2.1",
68
+ "@testing-library/react": "14.2.2",
69
69
  "@testing-library/user-event": "14.5.2",
70
70
  "@types/fetch-mock": "7.3.8",
71
71
  "@types/iframe-resizer": "3.5.13",
@@ -74,21 +74,21 @@
74
74
  "@types/lodash-es": "4.17.12",
75
75
  "@types/node-fetch": "2.6.11",
76
76
  "@types/query-string": "6.3.0",
77
- "@types/react": "18.2.64",
77
+ "@types/react": "18.2.70",
78
78
  "@types/react-autosuggest": "10.1.11",
79
- "@types/react-dom": "18.2.21",
79
+ "@types/react-dom": "18.2.22",
80
80
  "@types/react-modal": "3.16.3",
81
81
  "@types/uuid": "9.0.8",
82
- "@typescript-eslint/eslint-plugin": "7.1.1",
83
- "@typescript-eslint/parser": "7.1.1",
82
+ "@typescript-eslint/eslint-plugin": "7.3.1",
83
+ "@typescript-eslint/parser": "7.3.1",
84
84
  "babel-jest": "29.7.0",
85
85
  "babel-loader": "9.1.3",
86
86
  "babel-plugin-react-intl": "8.2.25",
87
87
  "bootstrap": ">=4.6.0 <5",
88
88
  "classnames": "2.5.1",
89
89
  "cljs-merge": "1.1.1",
90
- "core-js": "3.36.0",
91
- "downshift": "8.4.0",
90
+ "core-js": "3.36.1",
91
+ "downshift": "9.0.0",
92
92
  "eslint": "8.57.0",
93
93
  "eslint-config-airbnb": "19.0.4",
94
94
  "eslint-config-airbnb-typescript": "18.0.0",
@@ -99,13 +99,13 @@
99
99
  "eslint-plugin-import": "2.29.1",
100
100
  "eslint-plugin-jsx-a11y": "6.8.0",
101
101
  "eslint-plugin-prettier": "5.1.3",
102
- "eslint-plugin-react": "7.34.0",
102
+ "eslint-plugin-react": "7.34.1",
103
103
  "eslint-plugin-react-hooks": "4.6.0",
104
104
  "eslint-plugin-storybook": "0.8.0",
105
105
  "fetch-mock": "9.11.0",
106
106
  "file-loader": "6.2.0",
107
107
  "glob": "10.3.10",
108
- "i18n-iso-countries": "7.10.1",
108
+ "i18n-iso-countries": "7.11.0",
109
109
  "iframe-resizer": "4.3.9",
110
110
  "intl-pluralrules": "2.0.1",
111
111
  "jest": "29.7.0",
@@ -113,7 +113,7 @@
113
113
  "js-cookie": "3.0.5",
114
114
  "lodash-es": "4.17.21",
115
115
  "mdn-polyfills": "5.20.0",
116
- "msw": "2.2.3",
116
+ "msw": "2.2.10",
117
117
  "node-fetch": ">2.6.6 <3",
118
118
  "nodemon": "3.1.0",
119
119
  "prettier": "3.2.5",
@@ -121,17 +121,17 @@
121
121
  "react": "18.2.0",
122
122
  "react-autosuggest": "10.1.0",
123
123
  "react-dom": "18.2.0",
124
- "react-hook-form": "7.51.0",
125
- "react-intl": "6.6.2",
124
+ "react-hook-form": "7.51.1",
125
+ "react-intl": "6.6.3",
126
126
  "react-modal": "3.16.1",
127
127
  "react-router-dom": "6.22.3",
128
- "sass": "1.71.1",
128
+ "sass": "1.72.0",
129
129
  "source-map-loader": "5.0.0",
130
- "storybook": "7.6.17",
130
+ "storybook": "8.0.4",
131
131
  "tsconfig-paths-webpack-plugin": "4.1.0",
132
- "typescript": "5.4.2",
132
+ "typescript": "5.4.3",
133
133
  "uuid": "9.0.1",
134
- "webpack": "5.90.3",
134
+ "webpack": "5.91.0",
135
135
  "webpack-cli": "5.1.4",
136
136
  "whatwg-fetch": "3.6.20",
137
137
  "xhr-mock": "2.5.1",
@@ -140,13 +140,17 @@
140
140
  },
141
141
  "resolutions": {
142
142
  "@testing-library/dom": "9.3.4",
143
- "@types/react": "18.2.64",
144
- "@types/react-dom": "18.2.21"
143
+ "@types/react": "18.2.70",
144
+ "@types/react-dom": "18.2.22"
145
145
  },
146
146
  "msw": {
147
147
  "workerDirectory": "../richie/static/richie/js"
148
148
  },
149
149
  "volta": {
150
150
  "node": "20.11.0"
151
+ },
152
+ "devDependencies": {
153
+ "@storybook/addon-mdx-gfm": "8.0.4",
154
+ "@storybook/addon-webpack5-compiler-babel": "3.0.3"
151
155
  }
152
156
  }