11import React from 'react' ;
2- import Enzyme , { mount , shallow } from 'enzyme' ;
2+ import Enzyme , { mount } from 'enzyme' ;
33import Adapter from 'enzyme-adapter-react-16' ;
44import Timecode from './index' ;
55
@@ -52,35 +52,35 @@ describe('<Timecode />', () => {
5252 component . unmount ( ) ;
5353 } ) ;
5454
55- test ( 'render format - HH:mm:ss.sss ' , ( ) => {
56- component = mount ( < Timecode format = "HH:mm:ss.sss " /> , {
55+ test ( 'render format - HH:mm:ss.SSS ' , ( ) => {
56+ component = mount ( < Timecode format = "HH:mm:ss.SSS " /> , {
5757 attachTo : document . getElementById ( 'root' ) ,
5858 } ) ;
5959
6060 expect ( component . html ( ) ) . toBe ( '<span>00:00:00.000</span>' ) ;
6161 component . unmount ( ) ;
6262 } ) ;
6363
64- test ( 'render format - H:mm:ss.sss ' , ( ) => {
65- component = mount ( < Timecode format = "H:mm:ss.sss " /> , {
64+ test ( 'render format - H:mm:ss.SSS ' , ( ) => {
65+ component = mount ( < Timecode format = "H:mm:ss.SSS " /> , {
6666 attachTo : document . getElementById ( 'root' ) ,
6767 } ) ;
6868
6969 expect ( component . html ( ) ) . toBe ( '<span>0:00:00.000</span>' ) ;
7070 component . unmount ( ) ;
7171 } ) ;
7272
73- test ( 'render format - H:?mm:ss.sss ' , ( ) => {
74- component = mount ( < Timecode format = "H:?mm:ss.sss " /> , {
73+ test ( 'render format - H:?mm:ss.SSS ' , ( ) => {
74+ component = mount ( < Timecode format = "H:?mm:ss.SSS " /> , {
7575 attachTo : document . getElementById ( 'root' ) ,
7676 } ) ;
7777
7878 expect ( component . html ( ) ) . toBe ( '<span>00:00.000</span>' ) ;
7979 component . unmount ( ) ;
8080 } ) ;
8181
82- test ( 'render format - H:?m:ss.sss ' , ( ) => {
83- component = mount ( < Timecode format = "H:?m:ss.sss " /> , {
82+ test ( 'render format - H:?m:ss.SSS ' , ( ) => {
83+ component = mount ( < Timecode format = "H:?m:ss.SSS " /> , {
8484 attachTo : document . getElementById ( 'root' ) ,
8585 } ) ;
8686
@@ -124,6 +124,24 @@ describe('<Timecode />', () => {
124124 component . unmount ( ) ;
125125 } ) ;
126126
127+ test ( 'render format - s.SSS' , ( ) => {
128+ component = mount ( < Timecode format = "s.SSS" /> , {
129+ attachTo : document . getElementById ( 'root' ) ,
130+ } ) ;
131+
132+ expect ( component . html ( ) ) . toBe ( '<span>0.000</span>' ) ;
133+ component . unmount ( ) ;
134+ } ) ;
135+
136+ test ( 'render format - s.SS' , ( ) => {
137+ component = mount ( < Timecode format = "s.SS" /> , {
138+ attachTo : document . getElementById ( 'root' ) ,
139+ } ) ;
140+
141+ expect ( component . html ( ) ) . toBe ( '<span>0.00</span>' ) ;
142+ component . unmount ( ) ;
143+ } ) ;
144+
127145 test ( 'render format w/ time - H:?m:ss (default)' , ( ) => {
128146 component = mount ( < Timecode time = { 3600000 } /> , {
129147 attachTo : document . getElementById ( 'root' ) ,
@@ -133,10 +151,10 @@ describe('<Timecode />', () => {
133151 component . unmount ( ) ;
134152 } ) ;
135153
136- test ( 'render format w/ time - H:?mm:ss.sss ' , ( ) => {
154+ test ( 'render format w/ time - H:?mm:ss.SSS ' , ( ) => {
137155 component = mount ( (
138156 < Timecode
139- format = "H:?mm:ss.sss "
157+ format = "H:?mm:ss.SSS "
140158 time = { 3600000 }
141159 />
142160 ) , {
@@ -147,10 +165,10 @@ describe('<Timecode />', () => {
147165 component . unmount ( ) ;
148166 } ) ;
149167
150- test ( 'render format w/ time - H:?m:ss.sss ' , ( ) => {
168+ test ( 'render format w/ time - H:?m:ss.SSS ' , ( ) => {
151169 component = mount ( (
152170 < Timecode
153- format = "H:?m:ss.sss "
171+ format = "H:?m:ss.SSS "
154172 time = { 3600000 }
155173 />
156174 ) , {
0 commit comments