All files / nexshop-web-contents/spec/helpers time-helper-spec.js

100% Statements 9/9
100% Branches 0/0
100% Functions 4/4
100% Lines 9/9
1 2 3 4 5 6 7 8 9 10 11 12 13 14 151x 1x 1x   1x 1x 1x 1x     1x 1x      
import React from 'react';
import {expect} from 'chai';
import {formatSeconds, formatSecondsToMinutes} from "../../src/helpers/time-helper";
 
describe('Time Helper Spec', () => {
    describe('formatSeconds', () => {
        it('formats seconds into given format mm:ss', () => {
            expect(formatSeconds(120, 'mm:ss')).to.equal('02:00');
        });
 
        it('formats seconds into given format hh:mm:ss', () => {
            expect(formatSeconds(120, 'hh:mm:ss')).to.equal('00:02:00');
        });
    });
});