From 588fc25e397a84f02e6cd0bc4a81e98345a04a7d Mon Sep 17 00:00:00 2001 From: Adam Shaw Date: Tue, 28 Jan 2014 00:03:23 -0800 Subject: [PATCH] fixup some existing tests --- tests/automated/aspectRatio.js | 11 +++++------ tests/automated/firstDay.js | 20 +++++++++----------- tests/automated/handleWindowResize.js | 3 ++- 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/tests/automated/aspectRatio.js b/tests/automated/aspectRatio.js index 9a15fe0..5a40650 100644 --- a/tests/automated/aspectRatio.js +++ b/tests/automated/aspectRatio.js @@ -128,12 +128,11 @@ describe('aspectRatio', function() { var width = $('.fc-content').width(); expect(width).toEqual(1000); }); - it('should set the height to width ratio to 0.5', function() { - var width = $('.fc-content').width(); - var height = $('.fc-content').height(); - var pxHeightPerCharacter = 22; - var defaultWeeksInCal = 7; - expect(height).toEqual(pxHeightPerCharacter * defaultWeeksInCal) + it('should cause rows to be natural height', function() { + var actualHeight = $('.fc-content').height(); + $('tr.fc-week td:first-child > div').css('min-height', '').css('background', 'red'); + var naturalHeight = $('.fc-content').height(); + expect(actualHeight).toEqual(naturalHeight) }); }); }); diff --git a/tests/automated/firstDay.js b/tests/automated/firstDay.js index b617468..4f7e58d 100644 --- a/tests/automated/firstDay.js +++ b/tests/automated/firstDay.js @@ -149,19 +149,17 @@ describe('First Day', function() { }); describe('when new firstDay options are set', function() { - it('should change the first day of the week', function() { - var options = { + it('should change the first day of week to Monday', function() { + $('#cal').fullCalendar({ firstDay: 1 - }; - $('#cal').fullCalendar(options); - var firstDayBeforeChange = $('.fc-day-header')[0]; - var newOptions = { + }); + expect($('.fc-day-header')[0]).toHaveClass('fc-mon'); + }); + it('shoule change the first day of week to Thursday', function() { + $('#cal').fullCalendar({ firstDay: 4 - }; - $('#cal').fullCalendar(newOptions); - var firstDayAfterChange = $('.fc-day-header')[0]; - expect(firstDayBeforeChange).toHaveClass('fc-mon'); - expect(firstDayAfterChange).toHaveClass('fc-thu'); + }); + expect($('.fc-day-header')[0]).toHaveClass('fc-thu'); }); }); }); \ No newline at end of file diff --git a/tests/automated/handleWindowResize.js b/tests/automated/handleWindowResize.js index bc050c4..0731287 100644 --- a/tests/automated/handleWindowResize.js +++ b/tests/automated/handleWindowResize.js @@ -5,7 +5,8 @@ describe('handleWindowResize', function() { affix('#cal'); }); - describe('When default is used, should fire resize event', function() { + // not true + xdescribe('When default is used, should fire resize event', function() { it('should fire resize', function() { var resized = 0; $('#cal').fullCalendar({