File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed
sections/dataset/dataset-action-buttons Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -341,6 +341,7 @@ export class DatasetMother {
341341 const dataset = {
342342 id : faker . datatype . number ( ) ,
343343 persistentId : faker . datatype . uuid ( ) ,
344+ datasetType : 'dataset' ,
344345 version : DatasetVersionMother . create ( ) ,
345346 internalVersionNumber : faker . datatype . number ( ) ,
346347 license : {
@@ -450,7 +451,8 @@ export class DatasetMother {
450451 dataset . nextMajorVersion ,
451452 dataset . nextMinorVersion ,
452453 dataset . requiresMajorVersionUpdate ,
453- dataset . fileStore
454+ dataset . fileStore ,
455+ dataset . datasetType
454456 ) . build ( )
455457 }
456458
Original file line number Diff line number Diff line change @@ -73,6 +73,33 @@ describe('DatasetActionButtons', () => {
7373 cy . findByRole ( 'button' , { name : 'Share' } ) . should ( 'exist' )
7474 } )
7575
76+ it . only ( 'renders the DatasetActionButtons with the Edit Dataset button and dropdown' , ( ) => {
77+ const dataset = DatasetMother . create ( {
78+ version : DatasetVersionMother . createDraftAsLatestVersionWithSomeVersionHasBeenReleased ( ) ,
79+ permissions : DatasetPermissionsMother . create ( {
80+ canDownloadFiles : true ,
81+ canUpdateDataset : true ,
82+ canPublishDataset : false
83+ } ) ,
84+ fileDownloadSizes : [
85+ DatasetFileDownloadSizeMother . createOriginal ( { value : 2000 , unit : FileSizeUnit . BYTES } )
86+ ]
87+ } )
88+
89+ cy . mountAuthenticated (
90+ < DatasetActionButtons
91+ dataset = { dataset }
92+ datasetRepository = { datasetRepository }
93+ collectionRepository = { collectionRepository }
94+ contactRepository = { contactRepository }
95+ />
96+ )
97+
98+ cy . findByRole ( 'group' , { name : 'Dataset Action Buttons' } ) . should ( 'exist' )
99+ cy . findByRole ( 'button' , { name : 'Edit Dataset' } ) . click ( )
100+ cy . findByRole ( 'button' , { name : 'Metadata' } ) . click ( )
101+ } )
102+
76103 it ( 'should not render Share button if the the dataset is deaccessioned and user has no edit permission' , ( ) => {
77104 const dataset = DatasetMother . createDeaccessionedwithNoEditPermission ( )
78105 cy . mountAuthenticated (
You can’t perform that action at this time.
0 commit comments