File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -138,11 +138,26 @@ test("Should show error toast if error is thrown in selectHeaderStepHook", async
138138 } )
139139} )
140140
141- test ( "dateFormat property should be applied to dates read from csv files" , async ( ) => {
141+ test ( "dateFormat property should NOT be applied to dates read from csv files IF parseRaw=true " , async ( ) => {
142142 const file = new File ( [ RAW_DATE ] , "test.csv" , {
143143 type : "text/csv" ,
144144 } )
145- render ( < ReactSpreadsheetImport { ...mockRsiValues } dateFormat = "yyyy/mm/dd" /> )
145+ render ( < ReactSpreadsheetImport { ...mockRsiValues } dateFormat = "yyyy/mm/dd" parseRaw = { true } /> )
146+
147+ const uploader = screen . getByTestId ( "rsi-dropzone" )
148+ fireEvent . drop ( uploader , {
149+ target : { files : [ file ] } ,
150+ } )
151+
152+ const el = await screen . findByText ( RAW_DATE , undefined , { timeout : 5000 } )
153+ expect ( el ) . toBeInTheDocument ( )
154+ } )
155+
156+ test ( "dateFormat property should be applied to dates read from csv files IF parseRaw=false" , async ( ) => {
157+ const file = new File ( [ RAW_DATE ] , "test.csv" , {
158+ type : "text/csv" ,
159+ } )
160+ render ( < ReactSpreadsheetImport { ...mockRsiValues } dateFormat = "yyyy/mm/dd" parseRaw = { false } /> )
146161
147162 const uploader = screen . getByTestId ( "rsi-dropzone" )
148163 fireEvent . drop ( uploader , {
You can’t perform that action at this time.
0 commit comments