From ea87e0832a830126a7c518915316c9c8b5264314 Mon Sep 17 00:00:00 2001 From: Jakob Scheid Date: Thu, 4 Jun 2026 14:40:34 +0200 Subject: [PATCH] test(settings): add unit test for the settings validator validateSelectionOptions function for test cases that should throw an error --- .../utils/__tests__/settingsValidator.test.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/features/settings/utils/__tests__/settingsValidator.test.js b/src/features/settings/utils/__tests__/settingsValidator.test.js index ced00fd..bb251af 100644 --- a/src/features/settings/utils/__tests__/settingsValidator.test.js +++ b/src/features/settings/utils/__tests__/settingsValidator.test.js @@ -33,6 +33,17 @@ describe('validateSelectionOptions', () => { ])('throws no error for the options %s', ([ options ]) => { expect(() => validateSelectionOptions(options)).not.throws(Error); }); + + test.for([ + [[{ name: '', i18n: 'test.label' }]], + [[{ name: 'test', i18n: '' }]], + [[{ name: '', i18n: '' }]], + [[{ name: '', i18n: 'test.label' }, { name: 'test2', i18n: '' }]], + [[{ name: 'test', i18n: '' }, { name: '', i18n: 'test2.label' }, { name: '', i18n: ' ' }, { name: '42', i18n: '42.i18n' }]], + [[]] + ])('throws an error for the options %s', ([ options ]) => { + expect(() => validateSelectionOptions(options)).throws(Error); + }); }); describe('assertType', () => {