Skip to content

Commit

Permalink
adds new tests i guess
Browse files Browse the repository at this point in the history
  • Loading branch information
dplumlee committed Oct 21, 2020
1 parent 0280095 commit 44595aa
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -306,12 +306,24 @@ describe('rule helpers', () => {
expect(result).toEqual('2s');
});

test('returns from as seconds if from duration is specified in seconds greater than 60', () => {
const result = getHumanizedDuration('now-122s', '1m');

expect(result).toEqual('62s');
});

test('returns from as minutes if from duration is specified in minutes', () => {
const result = getHumanizedDuration('now-660s', '5m');

expect(result).toEqual('6m');
});

test('returns from as minutes if from duration is specified in minutes greater than 60', () => {
const result = getHumanizedDuration('now-6600s', '5m');

expect(result).toEqual('105m');
});

test('returns from as hours if from duration is specified in hours', () => {
const result = getHumanizedDuration('now-7500s', '5m');

Expand Down

0 comments on commit 44595aa

Please sign in to comment.