Skip to content

Commit 0d74fe9

Browse files
committed
test: themes.ts
1 parent d8d41f2 commit 0d74fe9

File tree

2 files changed

+67
-0
lines changed

2 files changed

+67
-0
lines changed

‎__test__/fakeInputs.js‎

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,11 +318,65 @@ const dummyWeeksData = [
318318
},
319319
];
320320

321+
constthemes={
322+
dracula: {
323+
bgColor: '44475a',
324+
color: 'f8f8f2',
325+
lineColor: 'ff79c6',
326+
pointColor: 'bd93f9',
327+
},
328+
329+
gruvbox: {
330+
bgColor: '504945',
331+
color: 'd4be98',
332+
lineColor: 'd8a657',
333+
pointColor: 'e78a4e',
334+
},
335+
336+
github: {
337+
bgColor: '293036',
338+
color: 'ffffff',
339+
lineColor: '9ecbff',
340+
pointColor: 'f97583',
341+
},
342+
rogue: {
343+
bgColor: '172030',
344+
color: 'a3b09a',
345+
lineColor: 'b18bb1',
346+
pointColor: 'c6797e',
347+
},
348+
xcode: {
349+
bgColor: '202124',
350+
color: 'fcfcfa',
351+
lineColor: 'c4e3ff',
352+
pointColor: 'ff8070',
353+
},
354+
redical: {
355+
bgColor: '141321',
356+
color: 'a9fef7',
357+
lineColor: 'fe428e',
358+
pointColor: 'f8d847',
359+
},
360+
coral: {
361+
bgColor: '9a3838',
362+
color: 'f9fae9',
363+
lineColor: 'f4e23d',
364+
pointColor: 'f4e7e7',
365+
},
366+
default: {
367+
bgColor: 'ffcfe9',
368+
color: '9e4c98',
369+
lineColor: '9e4c98',
370+
pointColor: '403d3d',
371+
},
372+
};
373+
321374
module.exports={
322375
fakeQueryString,
323376
fakeQueryStringRes,
324377
fakeGraphArgs,
325378
options,
326379
dummyWeeksData,
327380
expectedQuery,
381+
themes,
328382
};

‎__test__/themes.test.js‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const{ selectColors }=require('../styles/themes');
2+
const{ themes }=require('./fakeInputs');
3+
4+
it('Theme testing',()=>{
5+
expect(selectColors('dracula')).toEqual(themes['dracula']);
6+
expect(selectColors('gruvbox')).toEqual(themes['gruvbox']);
7+
expect(selectColors('github')).toEqual(themes['github']);
8+
expect(selectColors('rogue')).toEqual(themes['rogue']);
9+
expect(selectColors('redical')).toEqual(themes['redical']);
10+
expect(selectColors('xcode')).toEqual(themes['xcode']);
11+
expect(selectColors('coral')).toEqual(themes['coral']);
12+
expect(selectColors('default')).toEqual(themes['default']);
13+
});

0 commit comments

Comments
(0)