Skip to content

Commit

Permalink
fix component tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ekraffmiller committed Oct 29, 2024
1 parent d57826a commit c8eec6b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 10 deletions.
15 changes: 14 additions & 1 deletion tests/component/sections/account/Account.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
import { Account } from '../../../../src/sections/account/Account'
import { AccountHelper } from '../../../../src/sections/account/AccountHelper'
import { CollectionRepository } from '@/collection/domain/repositories/CollectionRepository'
import { CollectionMother } from '@tests/component/collection/domain/models/CollectionMother'
const collectionRepository = {} as CollectionRepository
const collection = CollectionMother.create({ name: 'Root' })

describe('Account', () => {
beforeEach(() => {
collectionRepository.getById = cy.stub().resolves(collection)
})
it('should render the correct breadcrumbs', () => {
cy.mountAuthenticated(<Account />)
cy.mountAuthenticated(
<Account
collectionRepository={collectionRepository}
defaultActiveTabKey={AccountHelper.ACCOUNT_PANEL_TABS_KEYS.apiToken}
/>
)

cy.findByRole('link', { name: 'Root' }).should('exist')

Expand Down
18 changes: 9 additions & 9 deletions tests/component/sections/collection/Collection.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('Collection page', () => {
cy.customMount(
<Collection
collectionRepository={collectionRepository}
collectionId="collection"
collectionIdFromParams="collection"
created={false}
published={false}
collectionQueryParams={{ pageQuery: 1 }}
Expand All @@ -46,7 +46,7 @@ describe('Collection page', () => {
cy.customMount(
<Collection
collectionRepository={collectionRepository}
collectionId="collection"
collectionIdFromParams="collection"
created={false}
published={false}
collectionQueryParams={{ pageQuery: 1 }}
Expand All @@ -60,7 +60,7 @@ describe('Collection page', () => {
cy.customMount(
<Collection
collectionRepository={collectionRepository}
collectionId="collection"
collectionIdFromParams="collection"
created={false}
published={false}
collectionQueryParams={{ pageQuery: 1 }}
Expand All @@ -74,7 +74,7 @@ describe('Collection page', () => {
cy.customMount(
<Collection
collectionRepository={collectionRepository}
collectionId="collection"
collectionIdFromParams="collection"
created={false}
published={false}
collectionQueryParams={{ pageQuery: 1 }}
Expand All @@ -87,7 +87,7 @@ describe('Collection page', () => {
cy.customMount(
<Collection
collectionRepository={collectionRepository}
collectionId="collection"
collectionIdFromParams="collection"
created={false}
published={false}
collectionQueryParams={{ pageQuery: 1 }}
Expand All @@ -100,7 +100,7 @@ describe('Collection page', () => {
cy.mountAuthenticated(
<Collection
collectionRepository={collectionRepository}
collectionId="collection"
collectionIdFromParams="collection"
created={false}
published={false}
collectionQueryParams={{ pageQuery: 1 }}
Expand All @@ -118,7 +118,7 @@ describe('Collection page', () => {
cy.customMount(
<Collection
collectionRepository={collectionRepository}
collectionId="collection"
collectionIdFromParams="collection"
created
published={false}
collectionQueryParams={{ pageQuery: 1 }}
Expand All @@ -131,7 +131,7 @@ describe('Collection page', () => {
cy.customMount(
<Collection
collectionRepository={collectionRepository}
collectionId="collection"
collectionIdFromParams="collection"
created={false}
published={true}
collectionQueryParams={{ pageQuery: 1 }}
Expand All @@ -152,7 +152,7 @@ describe('Collection page', () => {
cy.mountAuthenticated(
<Collection
collectionRepository={collectionRepository}
collectionId="collection"
collectionIdFromParams="collection"
created={false}
published={false}
collectionQueryParams={{ pageQuery: 1 }}
Expand Down

0 comments on commit c8eec6b

Please sign in to comment.