mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-04 09:39:23 +00:00
Add tests for timezoneOffsetToUtc filter
This commit is contained in:
parent
a87647995d
commit
d2c50c7889
1 changed files with 20 additions and 0 deletions
20
test/spec/filters/timezoneOffsetToUtcSpec.js
Normal file
20
test/spec/filters/timezoneOffsetToUtcSpec.js
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
describe('timezoneOffsetToUtc', function() {
|
||||
|
||||
beforeEach(module('habitrpg'));
|
||||
|
||||
it('formats the timezone offset with a - sign if the offset is positive', inject(function(timezoneOffsetToUtcFilter) {
|
||||
expect(timezoneOffsetToUtcFilter(90)).to.eql('UTC-1:30');
|
||||
}));
|
||||
|
||||
it('formats the timezone offset with a + sign if the offset is negative', inject(function(timezoneOffsetToUtcFilter) {
|
||||
expect(timezoneOffsetToUtcFilter(-525)).to.eql('UTC+8:45');
|
||||
}));
|
||||
|
||||
it('prepends the minutes with a 0 if the minute the offset is less than 10', inject(function(timezoneOffsetToUtcFilter) {
|
||||
expect(timezoneOffsetToUtcFilter(60)).to.eql('UTC-1:00');
|
||||
}));
|
||||
|
||||
it('returns the string UTC+0:00 if the offset is 0', inject(function(timezoneOffsetToUtcFilter) {
|
||||
expect(timezoneOffsetToUtcFilter(0)).to.eql('UTC+0:00');
|
||||
}));
|
||||
});
|
||||
Loading…
Reference in a new issue