Commit f5e24ca 1 parent aa3ace1 commit f5e24ca Copy full SHA for f5e24ca
File tree 1 file changed +20
-0
lines changed
tests/component/sections/collection/collection-items-panel/file-card
1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -40,4 +40,24 @@ describe('FileCard', () => {
40
40
filePreview . variables && cy . contains ( filePreview . variables ) . should ( 'exist' )
41
41
filePreview . observations && cy . contains ( filePreview . observations ) . should ( 'exist' )
42
42
} )
43
+ it ( 'should render the card if dateset is draft version' , ( ) => {
44
+ const filePreview = FileItemTypePreviewMother . create ( {
45
+ publicationStatuses : [ 'Draft' ]
46
+ } )
47
+ cy . customMount ( < FileCard filePreview = { filePreview } /> )
48
+
49
+ cy . contains ( DateHelper . toDisplayFormat ( filePreview . releaseOrCreateDate ) ) . should ( 'exist' )
50
+ cy . contains ( filePreview . fileType ) . should ( 'exist' )
51
+ filePreview . checksum ?. type && cy . contains ( filePreview . checksum ?. type ) . should ( 'exist' )
52
+ cy . contains ( FileCardHelper . formatBytesToCompactNumber ( filePreview . sizeInBytes ) ) . should ( 'exist' )
53
+ filePreview . description && cy . findByText ( filePreview . description ) . should ( 'exist' )
54
+ filePreview . datasetName && cy . findByText ( filePreview . datasetName ) . should ( 'exist' )
55
+ filePreview . tags &&
56
+ filePreview . tags . forEach ( ( tag ) => {
57
+ cy . findByText ( tag . value ) . should ( 'exist' )
58
+ } )
59
+ cy . findByRole ( 'link' , { name : filePreview . datasetName } )
60
+ . should ( 'have.attr' , 'href' )
61
+ . and ( 'include' , 'version=DRAFT' )
62
+ } )
43
63
} )
You can’t perform that action at this time.
0 commit comments