Skip to content
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

change reinvented story phase #974

Merged
merged 2 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/components/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,14 @@ export const Navigation = (): JSX.Element => {
phase: 2,
disabled: isParent,
},
// ---- PHASE 3 ----
{
label: 'Inventer une histoire',
path: '/creer-une-histoire',
icon: <StoryIcon style={{ fill: 'currentcolor' }} width="1.4rem" />,
phase: 3,
phase: 2,
disabled: isParent,
},
// ---- PHASE 3 ----
{
label: 'Ré-inventer une histoire',
path: '/re-inventer-une-histoire',
Expand Down
38 changes: 16 additions & 22 deletions src/components/activities/__tests__/getActivityPhase_utils.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ describe('Test function getActivityPhase', () => {
expect(getActivityPhase(ActivityType.ANTHEM, activePhase, selectedPhase)).toEqual(activePhase);
});
it.each(activitiesArray)(
'should return phase 2 for Mascotte, Presentation, Contenu Libre, Enigme, Defi, Question, Game, Reportage, Reaction ',
'should return phase 2 for Mascotte, Presentation, Contenu Libre, Enigme, Defi, Question, Game, Reportage, Reaction, Story ',
(type) => {
switch (Number(type)) {
case ActivityType.PRESENTATION:
Expand All @@ -215,6 +215,7 @@ describe('Test function getActivityPhase', () => {
case ActivityType.MASCOTTE:
case ActivityType.REPORTAGE:
case ActivityType.REACTION:
case ActivityType.STORY:
expect(getActivityPhase(Number(type), activePhase, selectedPhase)).toEqual(selectedPhase);
break;
}
Expand All @@ -228,7 +229,6 @@ describe('Test function getActivityPhase', () => {
case ActivityType.INDICE:
case ActivityType.SYMBOL:
case ActivityType.CLASS_ANTHEM:
case ActivityType.STORY:
case ActivityType.RE_INVENT_STORY:
expect(phases).not.toEqual(expect.arrayContaining([selectedPhase]));
break;
Expand All @@ -240,7 +240,6 @@ describe('Test function getActivityPhase', () => {
case ActivityType.INDICE:
case ActivityType.SYMBOL:
case ActivityType.CLASS_ANTHEM:
case ActivityType.STORY:
case ActivityType.RE_INVENT_STORY:
expect(() => {
getActivityPhase(Number(type), activePhase, selectedPhase);
Expand Down Expand Up @@ -354,7 +353,7 @@ describe('Test function getActivityPhase', () => {
expect(getActivityPhase(ActivityType.ANTHEM, activePhase, selectedPhase)).toEqual(activePhase);
});
it.each(activitiesArray)(
'should return phase 2 for Mascotte, Presentation, Contenu Libre, Enigme, Defi, Question, Game, Reportage, Reaction ',
'should return phase 2 for Mascotte, Presentation, Contenu Libre, Enigme, Defi, Question, Game, Reportage, Reaction, Story ',
(type) => {
switch (Number(type)) {
case ActivityType.PRESENTATION:
Expand All @@ -366,6 +365,7 @@ describe('Test function getActivityPhase', () => {
case ActivityType.MASCOTTE:
case ActivityType.REPORTAGE:
case ActivityType.REACTION:
case ActivityType.STORY:
expect(getActivityPhase(Number(type), activePhase, selectedPhase)).toEqual(selectedPhase);
break;
}
Expand All @@ -379,7 +379,6 @@ describe('Test function getActivityPhase', () => {
case ActivityType.INDICE:
case ActivityType.SYMBOL:
case ActivityType.CLASS_ANTHEM:
case ActivityType.STORY:
case ActivityType.RE_INVENT_STORY:
expect(phases).not.toEqual(expect.arrayContaining([selectedPhase]));
break;
Expand All @@ -391,7 +390,6 @@ describe('Test function getActivityPhase', () => {
case ActivityType.INDICE:
case ActivityType.SYMBOL:
case ActivityType.CLASS_ANTHEM:
case ActivityType.STORY:
case ActivityType.RE_INVENT_STORY:
expect(() => {
getActivityPhase(Number(type), activePhase, selectedPhase);
Expand All @@ -405,22 +403,18 @@ describe('Test function getActivityPhase', () => {
it('should return activePhase for ANTHEM', () => {
expect(getActivityPhase(ActivityType.ANTHEM, activePhase, selectedPhase)).toEqual(activePhase);
});
it.each(activitiesArray)(
'should return phase 3 for Mascotte, Presentation, Contenu Libre, Question, Story, Reinvent story, Vers record ',
(type) => {
switch (Number(type)) {
case ActivityType.PRESENTATION:
case ActivityType.QUESTION:
case ActivityType.CONTENU_LIBRE:
case ActivityType.MASCOTTE:
case ActivityType.STORY:
case ActivityType.RE_INVENT_STORY:
case ActivityType.CLASS_ANTHEM:
expect(getActivityPhase(Number(type), activePhase, selectedPhase)).toEqual(selectedPhase);
break;
}
},
);
it.each(activitiesArray)('should return phase 3 for Mascotte, Presentation, Contenu Libre, Question, Reinvent story, Vers record ', (type) => {
switch (Number(type)) {
case ActivityType.PRESENTATION:
case ActivityType.QUESTION:
case ActivityType.CONTENU_LIBRE:
case ActivityType.MASCOTTE:
case ActivityType.RE_INVENT_STORY:
case ActivityType.CLASS_ANTHEM:
expect(getActivityPhase(Number(type), activePhase, selectedPhase)).toEqual(selectedPhase);
break;
}
});
it.each(activitiesArray)(
'Mascotte, Presentation, Contenu Libre, Question, Story, Reinvent story, Vers record should have selectedPhase in specificActivityPhase',
(type, ...phaseArray) => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/activities/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export const specificActivityPhase = {
[ActivityType.REACTION]: [PhaseType.TWO],
[ActivityType.ANTHEM]: [],
[ActivityType.CLASS_ANTHEM]: [PhaseType.THREE],
[ActivityType.STORY]: [PhaseType.THREE],
[ActivityType.STORY]: [PhaseType.TWO],
[ActivityType.RE_INVENT_STORY]: [PhaseType.THREE],
};
export const getActivityPhase = (activityType: number, activePhase: number, selectedPhase: number) => {
Expand Down
Loading