[TNL-7268] Add high priority tests

This commit is contained in:
Agrendalath
2020-06-29 03:56:42 +02:00
committed by David Joy
parent ec7f532bc9
commit 8719fad091
14 changed files with 1155 additions and 355 deletions

View File

@@ -1,48 +1,11 @@
import React from 'react';
import { fireEvent } from '@testing-library/dom';
import { render, screen } from '../../../../test/test-utils';
import {
initialState, render, screen, testUnits,
} from '../../../../setupTest';
import UnitNavigation from './UnitNavigation';
describe('Unit Navigation', () => {
const testUnits = [...Array(10).keys()].map(i => String(i + 1));
const initialState = {
courseware: {
sequenceStatus: 'loaded',
courseStatus: 'loaded',
courseId: '1',
},
models: {
courses: {
1: {
sectionIds: ['1'],
},
},
sections: {
1: {
sequenceIds: ['1', '2'],
},
},
sequences: {
1: {
unitIds: testUnits,
showCompletion: true,
},
2: {
unitIds: testUnits,
showCompletion: true,
},
},
units: testUnits.reduce(
(acc, unitId) => Object.assign(acc, {
[unitId]: {
contentType: 'other',
title: unitId,
},
}),
{},
),
},
};
const mockData = {
sequenceId: '1',
unitId: '2',