@@ -6,14 +6,14 @@ import { WithLoggedInUser } from '../WithLoggedInUser'
66import { CollectionMockRepository } from '../collection/CollectionMockRepository'
77import { CollectionLoadingMockRepository } from '../collection/CollectionLoadingMockRepository'
88import { NoCollectionMockRepository } from '../collection/NoCollectionMockRepository'
9- import { CollectionMother } from '../../../tests/component/collection/domain/models/CollectionMother'
10- import { FakerHelper } from '../../../tests/component/shared/FakerHelper'
9+ import { CollectionMother } from '@tests/component/collection/domain/models/CollectionMother'
10+ import { FakerHelper } from '@tests/component/shared/FakerHelper'
11+ import { ROOT_COLLECTION_ALIAS } from '@tests/e2e-integration/shared/collection/ROOT_COLLECTION_ALIAS'
12+ import { UpwardHierarchyNodeMother } from '@tests/component/shared/hierarchy/domain/models/UpwardHierarchyNodeMother'
1113import { MetadataBlockInfoMockRepository } from '../shared-mock-repositories/metadata-block-info/MetadataBlockInfoMockRepository'
1214import { MetadataBlockInfoMockLoadingRepository } from '../shared-mock-repositories/metadata-block-info/MetadataBlockInfoMockLoadingRepository'
1315import { MetadataBlockInfoMockErrorRepository } from '../shared-mock-repositories/metadata-block-info/MetadataBlockInfoMockErrorRepository'
1416
15- import { ROOT_COLLECTION_ALIAS } from '@tests/e2e-integration/shared/collection/ROOT_COLLECTION_ALIAS'
16-
1717const meta : Meta < typeof EditCollection > = {
1818 title : 'Pages/Edit Collection' ,
1919 component : EditCollection ,
@@ -27,6 +27,43 @@ export default meta
2727type Story = StoryObj < typeof EditCollection >
2828
2929export const Default : Story = {
30+ render : ( ) => {
31+ const collectionRepo = new CollectionMockRepository ( )
32+ collectionRepo . getById = ( ) => {
33+ return new Promise ( ( resolve ) => {
34+ setTimeout ( ( ) => {
35+ resolve (
36+ CollectionMother . create ( {
37+ id : 'science' ,
38+ isReleased : true ,
39+ name : 'Collection Name' ,
40+ description : 'We do all the science.' ,
41+ affiliation : 'Scientific Research University' ,
42+ hierarchy : UpwardHierarchyNodeMother . createCollection ( {
43+ id : 'science' ,
44+ name : 'Collection Name' ,
45+ parent : UpwardHierarchyNodeMother . createCollection ( {
46+ id : ROOT_COLLECTION_ALIAS ,
47+ name : 'Root'
48+ } )
49+ } )
50+ } )
51+ )
52+ } , FakerHelper . loadingTimout ( ) )
53+ } )
54+ }
55+
56+ return (
57+ < EditCollection
58+ collectionId = "science"
59+ collectionRepository = { collectionRepo }
60+ metadataBlockInfoRepository = { new MetadataBlockInfoMockRepository ( ) }
61+ />
62+ )
63+ }
64+ }
65+
66+ export const EditingRoot : Story = {
3067 render : ( ) => (
3168 < EditCollection
3269 collectionId = { ROOT_COLLECTION_ALIAS }
@@ -35,6 +72,7 @@ export const Default: Story = {
3572 />
3673 )
3774}
75+
3876export const Loading : Story = {
3977 render : ( ) => (
4078 < EditCollection
0 commit comments