11import React from 'react'
22import { render } from '@testing-library/react'
3- import '@testing-library/jest-dom'
4- import { Timecode } from './Timecode'
3+ import Timecode from '.'
54
65describe ( '<Timecode />' , ( ) => {
76 test ( 'render markup - default component' , async ( ) => {
87 const { container, getByText } = render ( < Timecode /> )
98
10- expect ( getByText ( '0:00' ) ) . toBeInTheDocument ( )
9+ expect ( getByText ( '0:00' ) ) . toBeTruthy ( )
1110 expect ( container ) . toMatchSnapshot ( )
1211 } )
1312
@@ -20,79 +19,79 @@ describe('<Timecode />', () => {
2019 test ( 'render format - H:?m:ss (default)' , async ( ) => {
2120 const { getByText } = render ( < Timecode /> )
2221
23- expect ( getByText ( '0:00' ) ) . toBeInTheDocument ( )
22+ expect ( getByText ( '0:00' ) ) . toBeTruthy ( )
2423 } )
2524
2625 test ( 'render format - H:?mm:ss' , async ( ) => {
2726 const { getByText } = render ( < Timecode format = "H:?mm:ss" /> )
2827
29- expect ( getByText ( '00:00' ) ) . toBeInTheDocument ( )
28+ expect ( getByText ( '00:00' ) ) . toBeTruthy ( )
3029 } )
3130
3231 test ( 'render format - HH:mm:ss.SSS' , async ( ) => {
3332 const { getByText } = render ( < Timecode format = "HH:mm:ss.SSS" /> )
3433
35- expect ( getByText ( '00:00:00.000' ) ) . toBeInTheDocument ( )
34+ expect ( getByText ( '00:00:00.000' ) ) . toBeTruthy ( )
3635 } )
3736
3837 test ( 'render format - H:mm:ss.SSS' , async ( ) => {
3938 const { getByText } = render ( < Timecode format = "H:mm:ss.SSS" /> )
4039
41- expect ( getByText ( '0:00:00.000' ) ) . toBeInTheDocument ( )
40+ expect ( getByText ( '0:00:00.000' ) ) . toBeTruthy ( )
4241 } )
4342
4443 test ( 'render format - H:?mm:ss.SSS' , async ( ) => {
4544 const { getByText } = render ( < Timecode format = "H:?mm:ss.SSS" /> )
4645
47- expect ( getByText ( '00:00.000' ) ) . toBeInTheDocument ( )
46+ expect ( getByText ( '00:00.000' ) ) . toBeTruthy ( )
4847 } )
4948
5049 test ( 'render format - H:?m:ss.SSS' , async ( ) => {
5150 const { getByText } = render ( < Timecode format = "H:?m:ss.SSS" /> )
5251
53- expect ( getByText ( '0:00.000' ) ) . toBeInTheDocument ( )
52+ expect ( getByText ( '0:00.000' ) ) . toBeTruthy ( )
5453 } )
5554
5655 test ( 'render format - HH:mm:ss' , async ( ) => {
5756 const { getByText } = render ( < Timecode format = "HH:mm:ss" /> )
5857
59- expect ( getByText ( '00:00:00' ) ) . toBeInTheDocument ( )
58+ expect ( getByText ( '00:00:00' ) ) . toBeTruthy ( )
6059 } )
6160
6261 test ( 'render format - H:mm:ss' , async ( ) => {
6362 const { getByText } = render ( < Timecode format = "H:mm:ss" /> )
6463
65- expect ( getByText ( '0:00:00' ) ) . toBeInTheDocument ( )
64+ expect ( getByText ( '0:00:00' ) ) . toBeTruthy ( )
6665 } )
6766
6867 test ( 'render format - H:?mm:ss' , async ( ) => {
6968 const { getByText } = render ( < Timecode format = "H:?mm:ss" /> )
7069
71- expect ( getByText ( '00:00' ) ) . toBeInTheDocument ( )
70+ expect ( getByText ( '00:00' ) ) . toBeTruthy ( )
7271 } )
7372
7473 test ( 'render format - H:mm' , async ( ) => {
7574 const { getByText } = render ( < Timecode format = "H:mm" /> )
7675
77- expect ( getByText ( '0:00' ) ) . toBeInTheDocument ( )
76+ expect ( getByText ( '0:00' ) ) . toBeTruthy ( )
7877 } )
7978
8079 test ( 'render format - s.SSS' , async ( ) => {
8180 const { getByText } = render ( < Timecode format = "s.SSS" /> )
8281
83- expect ( getByText ( '0.000' ) ) . toBeInTheDocument ( )
82+ expect ( getByText ( '0.000' ) ) . toBeTruthy ( )
8483 } )
8584
8685 test ( 'render format - s.SS' , async ( ) => {
8786 const { getByText } = render ( < Timecode format = "s.SS" /> )
8887
89- expect ( getByText ( '0.00' ) ) . toBeInTheDocument ( )
88+ expect ( getByText ( '0.00' ) ) . toBeTruthy ( )
9089 } )
9190
9291 test ( 'render format w/ time - H:?m:ss (default)' , async ( ) => {
9392 const { getByText } = render ( < Timecode time = { 3600000 } /> )
9493
95- expect ( getByText ( '1:00:00' ) ) . toBeInTheDocument ( )
94+ expect ( getByText ( '1:00:00' ) ) . toBeTruthy ( )
9695 } )
9796
9897 test ( 'render format w/ time - H:?mm:ss.SSS' , async ( ) => {
@@ -103,7 +102,7 @@ describe('<Timecode />', () => {
103102 />
104103 ) )
105104
106- expect ( getByText ( '1:00:00.000' ) ) . toBeInTheDocument ( )
105+ expect ( getByText ( '1:00:00.000' ) ) . toBeTruthy ( )
107106 } )
108107
109108 test ( 'render format w/ time - H:?m:ss.SSS' , async ( ) => {
@@ -114,7 +113,7 @@ describe('<Timecode />', () => {
114113 />
115114 ) )
116115
117- expect ( getByText ( '1:00:00.000' ) ) . toBeInTheDocument ( )
116+ expect ( getByText ( '1:00:00.000' ) ) . toBeTruthy ( )
118117 } )
119118
120119 test ( 'render format w/ time - H:?mm:ss' , async ( ) => {
@@ -125,30 +124,30 @@ describe('<Timecode />', () => {
125124 />
126125 ) )
127126
128- expect ( getByText ( '1:00:00' ) ) . toBeInTheDocument ( )
127+ expect ( getByText ( '1:00:00' ) ) . toBeTruthy ( )
129128 } )
130129
131130 test ( 'render format w/ minutes - H:?m:ss (default)' , async ( ) => {
132131 const { getByText } = render ( < Timecode time = { 5400000 } /> )
133132
134- expect ( getByText ( '1:30:00' ) ) . toBeInTheDocument ( )
133+ expect ( getByText ( '1:30:00' ) ) . toBeTruthy ( )
135134 } )
136135
137136 test ( 'render format w/ seconds - H:?m:ss (default)' , async ( ) => {
138137 const { getByText } = render ( < Timecode time = { 5430000 } /> )
139138
140- expect ( getByText ( '1:30:30' ) ) . toBeInTheDocument ( )
139+ expect ( getByText ( '1:30:30' ) ) . toBeTruthy ( )
141140 } )
142141
143142 test ( 'render prefix' , async ( ) => {
144143 const { getByText } = render ( < Timecode prefix = "-" /> )
145144
146- expect ( getByText ( '-0:00' ) ) . toBeInTheDocument ( )
145+ expect ( getByText ( '-0:00' ) ) . toBeTruthy ( )
147146 } )
148147
149148 test ( 'render postfix' , async ( ) => {
150149 const { getByText } = render ( < Timecode postfix = "/left" /> )
151150
152- expect ( getByText ( '0:00/left' ) ) . toBeInTheDocument ( )
151+ expect ( getByText ( '0:00/left' ) ) . toBeTruthy ( )
153152 } )
154153} )
0 commit comments