Skip to content

Commit cdd9ba7

Browse files
committed
test: add minimal integration test for getting collection with a theme
1 parent abcc7e7 commit cdd9ba7

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

test/integration/collections/CollectionsRepository.test.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,17 @@ describe('CollectionsRepository', () => {
110110
expect(actual.alias).toBe(ROOT_COLLECTION_ALIAS)
111111
expect(actual.isReleased).toBe(true)
112112
})
113+
114+
test('should return theme for root collection', async () => {
115+
const actual = await sut.getCollection()
116+
expect(actual.alias).toBe(ROOT_COLLECTION_ALIAS)
117+
// Root collection might or might not have a theme, but the property should be present if it does
118+
// and we want to ensure the transformer doesn't fail.
119+
// In a default Dataverse installation, root theme is usually undefined or has some default values.
120+
if (actual.theme) {
121+
expect(actual.theme).toHaveProperty('id')
122+
}
123+
})
113124
})
114125
describe('by string alias', () => {
115126
test('should return collection when it exists filtering by id AS (alias)', async () => {

0 commit comments

Comments
 (0)