From 6e6215213dbaabdb0860798f4f3f837f9099ef0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Henrik=20=C3=98verland?= Date: Fri, 22 Nov 2024 10:53:28 +0100 Subject: [PATCH] test: add unit test for getOuLevelAndGroupText --- src/modules/__tests__/getOuLevelAndGroupText.spec.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/modules/__tests__/getOuLevelAndGroupText.spec.js b/src/modules/__tests__/getOuLevelAndGroupText.spec.js index a57a07539..21cb7319b 100644 --- a/src/modules/__tests__/getOuLevelAndGroupText.spec.js +++ b/src/modules/__tests__/getOuLevelAndGroupText.spec.js @@ -61,4 +61,15 @@ describe('getOuLevelAndGroupText', () => { 'Fruit and Veggies groups - Second floor levels' ) }) + + it('grabs name for user orgunits from items when not present in metaData', () => { + filter.items = [ + { id: 'USER_ORGUNIT', name: 'User organisation unit' }, + { id: 'LEVEL-2nd-floor' }, + ] + + expect(getOuLevelAndGroupText(filter, metaData)).toEqual( + 'Second floor levels in User organisation unit' + ) + }) })