diff --git a/tests/automated/fullCalendar.js b/tests/automated/fullCalendar.js index 9a55625..e2c3eb2 100644 --- a/tests/automated/fullCalendar.js +++ b/tests/automated/fullCalendar.js @@ -1,11 +1,16 @@ -describe('fullCalendar(Integration)', function() { +describe('fullCalendar constructor', function() { beforeEach(function() { affix('#calendar'); }); - describe('When fullCalendar() is called on a div', function() { + it('should return a jQuery object for chaining', function() { + var res = $('#calendar').fullCalendar(); + expect(res instanceof jQuery).toBe(true); + }); + + describe('when called on a div', function() { beforeEach(function() { $('#calendar').fullCalendar(); diff --git a/tests/automated/moment-ambig.js b/tests/automated/moment-ambig.js new file mode 100644 index 0000000..5d3c4fa --- /dev/null +++ b/tests/automated/moment-ambig.js @@ -0,0 +1,36 @@ + +describe('ambiguously-timed moment', function() { + + it('formats without a time and timezone part', function() { + var date = moment.utc('2014-01-01T06:00:00+00:00').stripTime(); + var s = date.format(); + expect(s).toEqual('2014-01-01'); + }); + + it('is still ambuously-timed after being cloned', function() { + var date = moment('2014-01-01T06:00:00-07:00').stripTime(); + var clone = date.clone(); + expect(date.hasTime()).toEqual(false); + expect(clone.hasTime()).toEqual(false); + }); + +}); + +describe('ambiguously-zoned moment', function() { + + it('formats without a timezone part', function() { + var date = moment.utc('2014-01-01T06:00:00+00:00').stripZone(); + var s = date.format(); + expect(s).toEqual('2014-01-01T06:00:00'); + }); + + it('is still ambiguously-zoned after being cloned', function() { + var date = moment('2014-01-01T06:00:00-07:00').stripZone(); + var clone = date.clone(); + expect(date.hasZone()).toEqual(false); + expect(clone.hasZone()).toEqual(false); + }); + +}); + +// TODO: also for $.fullCalendar.moment() and calendar.moment() \ No newline at end of file