Skip to content

Commit

Permalink
Test: add makeTimetable test code
Browse files Browse the repository at this point in the history
  • Loading branch information
ww8007 committed Mar 20, 2022
1 parent d5778b9 commit 37c7c38
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions frontend/src/lib/util/util.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import { makeTimetableWithStartEnd } from './makeTimetable';

describe('util functions test', () => {
it('makeTimetable', () => {
const { weekTimetableData } = makeTimetableWithStartEnd(0, 0);
expect(weekTimetableData[0]).toStrictEqual({
day: 'sun',
times: {
0: timeData
},
timeBackColor: ['#fff']
});
});
});

const timeData = [
{
color: '#fff',
mode: 'normal',
minute: 0,
borderBottom: false,
borderTop: true,
borderWidth: 0.3
},
{
color: '#fff',
mode: 'normal',
minute: 10,
borderBottom: false,
borderTop: false,
borderWidth: 0.3
},
{
color: '#fff',
mode: 'normal',
minute: 20,
borderBottom: false,
borderTop: false,
borderWidth: 0.3
},
{
color: '#fff',
mode: 'normal',
minute: 30,
borderBottom: false,
borderTop: false,
borderWidth: 0.3
},
{
color: '#fff',
mode: 'normal',
minute: 40,
borderBottom: false,
borderTop: false,
borderWidth: 0.3
},
{
color: '#fff',
mode: 'normal',
minute: 50,
borderBottom: false,
borderTop: false,
borderWidth: 0.3
}
];

0 comments on commit 37c7c38

Please sign in to comment.