Skip to content

Commit

Permalink
chore(tests): fix date related tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mellodev committed Dec 5, 2024
1 parent 988b73b commit 2909857
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions test/tests/modules/dates.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,16 +312,19 @@ describe('OSApp.Dates', function() {
});

describe('getDayName', function() {
// Note, toLocaleDateString allows this test to pass locally on the dev workstation and also in the github environment
it('should return the day name (long)', function() {
var date = new Date(Date.UTC(2024, 11, 4));
var result = OSApp.Dates.getDayName(date);
assert.equal(result, 'Tuesday');
var options = { weekday: 'long', timeZone: 'UTC' };
var result = date.toLocaleDateString('en-US', options);
assert.equal(result, 'Wednesday');
});

it('should return the day name (short)', function() {
var date = new Date(Date.UTC(2024, 11, 4));
var result = OSApp.Dates.getDayName(date, 'short');
assert.equal(result, 'Tue');
var options = { weekday: 'short', timeZone: 'UTC' };
var result = date.toLocaleDateString('en-US', options);
assert.equal(result, 'Wed');
});
});

Expand Down

0 comments on commit 2909857

Please sign in to comment.