From 8aed6b36ee253260f604fed29b767f6634d898f3 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sat, 22 Aug 2026 06:09:51 +0000 Subject: [PATCH] chore(lint): cover remaining slot-value rule branches Adds unit tests for unexpected slots with no alternative and unquoted slot attributes, raising line and branch coverage to 100%. Signed-off-by: Cursor Agent --- .../rules/no-unexpected-slot-value.test.ts | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/projects/lint/src/eslint/rules/no-unexpected-slot-value.test.ts b/projects/lint/src/eslint/rules/no-unexpected-slot-value.test.ts index d0324fff67..befa13cba4 100644 --- a/projects/lint/src/eslint/rules/no-unexpected-slot-value.test.ts +++ b/projects/lint/src/eslint/rules/no-unexpected-slot-value.test.ts @@ -199,4 +199,46 @@ describe('noUnexpectedSlotValue', () => { invalid: [] }); }); + + it('should report unexpected slot values without suggestions when no alternative exists', () => { + tester.run('unexpected slot with no alternative', rule, { + valid: [], + invalid: [ + { + code: '
', + errors: [ + { + messageId: 'unexpected-slot-value', + data: { slotName: 'invalid', tagName: 'div', parentTagName: 'nve-divider' }, + suggestions: [] + } + ] + } + ] + }); + }); + + it('should recommend replacing unquoted unexpected slot values', () => { + tester.run('unquoted unexpected slot values', rule, { + valid: [], + invalid: [ + { + code: '', + errors: [ + { + messageId: 'unexpected-slot-value', + data: { slotName: 'icon', tagName: 'nve-icon', parentTagName: 'nve-badge' }, + suggestions: [ + { + messageId: 'suggest-replace-slot-value', + data: { slotName: 'icon', alternative: 'prefix-icon' }, + output: '' + } + ] + } + ] + } + ] + }); + }); });