Skip to content

Commit

Permalink
User preferences test - getDefaultWidthHeight
Browse files Browse the repository at this point in the history
  • Loading branch information
araujoarthur0 authored and thamara committed Jun 5, 2020
1 parent 2b83cea commit 35df03e
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions __tests__/__main__/user-preferences.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable no-undef */
const { showDay, getUserPreferences } = require('../../js/user-preferences');
const { defaultPreferences, getDefaultWidthHeight, getUserPreferences, savePreferences, showDay } = require('../../js/user-preferences');

describe('Preferences Main', () => {
process.env.NODE_ENV = 'test';
Expand All @@ -14,8 +14,25 @@ describe('Preferences Main', () => {
expect(showDay(2020, 1, 5)).toBe(days['working-days-wednesday']);
expect(showDay(2020, 1, 6)).toBe(days['working-days-thursday']);
expect(showDay(2020, 1, 7)).toBe(days['working-days-friday']);

});

describe('getDefaultWidthHeight()', () => {

test('Month view', () => {
expect(defaultPreferences['view']).toBe('month');
savePreferences(defaultPreferences);

expect(getDefaultWidthHeight()).toStrictEqual({ width: 1010, height: 800 });
});

test('Day view', () => {
let preferences = defaultPreferences;

preferences['view'] = 'day';
savePreferences(preferences);

expect(getDefaultWidthHeight()).toStrictEqual({ width: 500, height: 500 });
});
});
});

0 comments on commit 35df03e

Please sign in to comment.