Skip to content

Commit

Permalink
test(structure): update test to documentPerspectiveList
Browse files Browse the repository at this point in the history
  • Loading branch information
RitaDias committed Feb 26, 2025
1 parent 4652829 commit 6dbbf5e
Showing 1 changed file with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,27 @@ describe('DocumentPerspectiveList', () => {

expect(screen.getByRole('button', {name: 'Published'})).toBeEnabled()
})

it('should disable the "Draft" chip when the document only has one version, no pinned version', async () => {
mockUseDocumentPane.mockReturnValue(
getPaneMock({
editStateDocuments: [],
displayedVersion: 'rSpringDrop',
isCreatingDocument: true,
}),
)

mockUsePerspective.mockReturnValue({
...usePerspectiveMockValue,
selectedPerspectiveName: undefined,
})
mockUseDocumentVersions.mockReturnValue({data: ['rSpringDrop'], loading: false, error: null})

const wrapper = await getTestProvider({liveEdit: false})
render(<DocumentPerspectiveList />, {wrapper})

expect(screen.getByRole('button', {name: 'Draft'})).toBeDisabled()
})
})

describe('selected chips', () => {
Expand Down

0 comments on commit 6dbbf5e

Please sign in to comment.