Skip to content

Commit b5ce945

Browse files
committed
fix: revert to mirage for tests
1 parent bbe91d3 commit b5ce945

File tree

5 files changed

+22
-16
lines changed

5 files changed

+22
-16
lines changed

cypress/e2e/analytics/main.cy.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ describe('Analytics View', () => {
2828
itemId: APP_ITEM.id,
2929
},
3030
);
31-
cy.visit(`/`);
31+
cy.visit('/');
3232
});
3333

3434
it('App', () => {
@@ -37,6 +37,7 @@ describe('Analytics View', () => {
3737

3838
describe('getting general statistics cards', () => {
3939
it('check total user comments statistic card display the right value', () => {
40+
cy.get(`#${ANALYTICS_GENERAL_TOTAL_COMMENTS_ID}`).scrollIntoView();
4041
cy.get(`#${ANALYTICS_GENERAL_TOTAL_COMMENTS_ID}`).should(
4142
'have.text',
4243
actions.length,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"@codemirror/lang-javascript": "^6.2.2",
1515
"@emotion/react": "11.14.0",
1616
"@emotion/styled": "11.14.0",
17-
"@graasp/apps-query-client": "3.7.3",
17+
"@graasp/apps-query-client": "github:graasp/graasp-apps-query-client#update-with-account",
1818
"@graasp/sdk": "^5.5.0",
1919
"@graasp/stylis-plugin-rtl": "^2.2.0",
2020
"@graasp/ui": "5.4.7",

src/main.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ if (MOCK_API) {
3232
appContext: window.Cypress ? window.appContext : defaultMockContext,
3333
database: window.Cypress ? window.database : buildDatabase(mockMembers),
3434
},
35-
MockSolution.ServiceWorker,
35+
window.Cypress ? MockSolution.MirageJS : MockSolution.ServiceWorker,
3636
);
3737
}
3838

src/modules/main/AnalyticsView.tsx

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next';
44
import CloudIcon from '@mui/icons-material/Cloud';
55
import CommentIcon from '@mui/icons-material/Comment';
66
import PeopleIcon from '@mui/icons-material/People';
7-
import { Alert, Box, Button, Grid, Typography } from '@mui/material';
7+
import { Alert, Box, Button, Grid2, Typography } from '@mui/material';
88

99
import { AppAction } from '@graasp/sdk';
1010
import { Loader } from '@graasp/ui';
@@ -45,8 +45,13 @@ const AnalyticsView = (): JSX.Element => {
4545
<Box>
4646
{commentsByUserSide ? (
4747
<>
48-
<Grid container spacing={2} marginTop={1} justifyContent="center">
49-
<Grid xs={12} md={4} item>
48+
<Grid2
49+
container
50+
spacing={2}
51+
marginTop={1}
52+
justifyContent="center"
53+
>
54+
<Grid2 size={{ xs: 12, md: 4 }}>
5055
<StatisticCard
5156
icon={<CommentIcon fontSize="large" color="primary" />}
5257
title={t('STATISTIC_TOTAL_USER_COMMENTS_TITLE')}
@@ -59,8 +64,8 @@ const AnalyticsView = (): JSX.Element => {
5964
{commentsByUserSide.length}
6065
</Typography>
6166
</StatisticCard>
62-
</Grid>
63-
<Grid xs={12} md={4} item>
67+
</Grid2>
68+
<Grid2 size={{ xs: 12, md: 4 }}>
6469
<StatisticCard
6570
icon={<PeopleIcon fontSize="large" color="primary" />}
6671
title={t('STATISTIC_AVERAGE_USER_COMMENTS_TITLE')}
@@ -70,8 +75,8 @@ const AnalyticsView = (): JSX.Element => {
7075
Object.keys(commentsByMembers).length}
7176
</Typography>
7277
</StatisticCard>
73-
</Grid>
74-
<Grid xs={12} md={4} item>
78+
</Grid2>
79+
<Grid2 size={{ xs: 12, md: 4 }}>
7580
<StatisticCard
7681
icon={<CloudIcon fontSize="large" color="primary" />}
7782
title={t('WORDS_FREQUENCY')}
@@ -85,8 +90,8 @@ const AnalyticsView = (): JSX.Element => {
8590
{t('SEE_WORDS_CLOUD')}
8691
</Button>
8792
</StatisticCard>
88-
</Grid>
89-
</Grid>
93+
</Grid2>
94+
</Grid2>
9095

9196
<FrequentWords
9297
commentsByUserSide={commentsByUserSide}

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2946,9 +2946,9 @@ __metadata:
29462946
languageName: node
29472947
linkType: hard
29482948

2949-
"@graasp/apps-query-client@npm:3.7.3":
2949+
"@graasp/apps-query-client@github:graasp/graasp-apps-query-client#update-with-account":
29502950
version: 3.7.3
2951-
resolution: "@graasp/apps-query-client@npm:3.7.3"
2951+
resolution: "@graasp/apps-query-client@https://github.com/graasp/graasp-apps-query-client.git#commit=fbfd31bb24256b255bfaa1afa86f004238502e32"
29522952
dependencies:
29532953
"@emotion/react": "npm:11.13.3"
29542954
"@emotion/styled": "npm:11.13.0"
@@ -2970,7 +2970,7 @@ __metadata:
29702970
date-fns: ^3.3.0 || ^4.0.0
29712971
react: ^18.0.0
29722972
react-dom: ^18.0.0
2973-
checksum: 10/a6ff4f2fa8635df76e1524d45dc749c8ce628867acaa0fba357851afba0d51296cb795ed5452761ce8a3a9116e6ccee6d579a252ec8abff6123fa8bf36a750a7
2973+
checksum: 10/3fb59af6221a5efe427a02118da70474fb2c5d2916669c36a36792c3e42062c608cab65d1437b8a8968ff80b8ccbdea0822bd7944c43df65d531a6488bd26b4f
29742974
languageName: node
29752975
linkType: hard
29762976

@@ -8608,7 +8608,7 @@ __metadata:
86088608
"@eslint/compat": "npm:^1.2.4"
86098609
"@eslint/eslintrc": "npm:^3.2.0"
86108610
"@eslint/js": "npm:^9.17.0"
8611-
"@graasp/apps-query-client": "npm:3.7.3"
8611+
"@graasp/apps-query-client": "github:graasp/graasp-apps-query-client#update-with-account"
86128612
"@graasp/sdk": "npm:^5.5.0"
86138613
"@graasp/stylis-plugin-rtl": "npm:^2.2.0"
86148614
"@graasp/ui": "npm:5.4.7"

0 commit comments

Comments
 (0)