diff --git a/api/tests/devcomp/unit/scripts/get-modules-csv_test.js b/api/tests/devcomp/unit/scripts/get-modules-csv_test.js index a1650527a58..fa69e428c7a 100644 --- a/api/tests/devcomp/unit/scripts/get-modules-csv_test.js +++ b/api/tests/devcomp/unit/scripts/get-modules-csv_test.js @@ -122,4 +122,24 @@ describe.only('when get total of elements', function () { // then expect(result).to.equal(2); }); + + it('should throw if component type is not available', function () { + // given + const grains = [ + { + components: [ + { + type: 'non-existing-component-type', + }, + ], + }, + ]; + + // when + const err = catchErrSync(_getTotalElements)(grains); + + // then + expect(err).to.be.an.instanceOf(Error); + expect(err.message).to.equal('Component type "non-existing-component-type" is not available'); + }); });