From 104fb979c3429c269b20e941b86bae79e61ea772 Mon Sep 17 00:00:00 2001 From: Steffen Waterkamp Date: Thu, 25 Mar 2021 14:02:05 +0100 Subject: [PATCH] Add test for parsing empty string in nvt tags as undefined --- gsa/src/gmp/models/__tests__/nvt.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gsa/src/gmp/models/__tests__/nvt.js b/gsa/src/gmp/models/__tests__/nvt.js index 56252013eb..ae319ea78d 100644 --- a/gsa/src/gmp/models/__tests__/nvt.js +++ b/gsa/src/gmp/models/__tests__/nvt.js @@ -66,6 +66,7 @@ describe('nvt Model tests', () => { const nvt1 = Nvt.fromElement({tags: 'bv=/A:P|st=vf'}); const nvt2 = Nvt.fromElement({}); const nvt3 = Nvt.fromElement({nvt: {tags: 'bv=/A:P|st=vf'}}); + const nvt4 = Nvt.fromElement({nvt: {tags: 'bv='}}); const res = { bv: '/A:P', st: 'vf', @@ -74,6 +75,7 @@ describe('nvt Model tests', () => { expect(nvt1.tags).toEqual(res); expect(nvt2.tags).toEqual({}); expect(nvt3.tags).toEqual(res); + expect(nvt4.tags.bv).toBeUndefined(); }); test('should parse refs', () => {