diff --git a/src/stories/edit-collection/EditCollection.stories.tsx b/src/stories/edit-collection/EditCollection.stories.tsx index 70607a6bf..44938f9ad 100644 --- a/src/stories/edit-collection/EditCollection.stories.tsx +++ b/src/stories/edit-collection/EditCollection.stories.tsx @@ -6,14 +6,14 @@ import { WithLoggedInUser } from '../WithLoggedInUser' import { CollectionMockRepository } from '../collection/CollectionMockRepository' import { CollectionLoadingMockRepository } from '../collection/CollectionLoadingMockRepository' import { NoCollectionMockRepository } from '../collection/NoCollectionMockRepository' -import { CollectionMother } from '../../../tests/component/collection/domain/models/CollectionMother' -import { FakerHelper } from '../../../tests/component/shared/FakerHelper' +import { CollectionMother } from '@tests/component/collection/domain/models/CollectionMother' +import { FakerHelper } from '@tests/component/shared/FakerHelper' +import { ROOT_COLLECTION_ALIAS } from '@tests/e2e-integration/shared/collection/ROOT_COLLECTION_ALIAS' +import { UpwardHierarchyNodeMother } from '@tests/component/shared/hierarchy/domain/models/UpwardHierarchyNodeMother' import { MetadataBlockInfoMockRepository } from '../shared-mock-repositories/metadata-block-info/MetadataBlockInfoMockRepository' import { MetadataBlockInfoMockLoadingRepository } from '../shared-mock-repositories/metadata-block-info/MetadataBlockInfoMockLoadingRepository' import { MetadataBlockInfoMockErrorRepository } from '../shared-mock-repositories/metadata-block-info/MetadataBlockInfoMockErrorRepository' -import { ROOT_COLLECTION_ALIAS } from '@tests/e2e-integration/shared/collection/ROOT_COLLECTION_ALIAS' - const meta: Meta = { title: 'Pages/Edit Collection', component: EditCollection, @@ -27,6 +27,43 @@ export default meta type Story = StoryObj export const Default: Story = { + render: () => { + const collectionRepo = new CollectionMockRepository() + collectionRepo.getById = () => { + return new Promise((resolve) => { + setTimeout(() => { + resolve( + CollectionMother.create({ + id: 'science', + isReleased: true, + name: 'Collection Name', + description: 'We do all the science.', + affiliation: 'Scientific Research University', + hierarchy: UpwardHierarchyNodeMother.createCollection({ + id: 'science', + name: 'Collection Name', + parent: UpwardHierarchyNodeMother.createCollection({ + id: ROOT_COLLECTION_ALIAS, + name: 'Root' + }) + }) + }) + ) + }, FakerHelper.loadingTimout()) + }) + } + + return ( + + ) + } +} + +export const EditingRoot: Story = { render: () => ( ) } + export const Loading: Story = { render: () => ( { cy.mountAuthenticated(