From f4bf6887b98a97e1975ad826a36468e8f3920278 Mon Sep 17 00:00:00 2001 From: Amruth Pillai Date: Mon, 17 Aug 2026 22:19:52 +0200 Subject: [PATCH] test(stylesheet): complete system variables at the end of the prefix The case passed cursor position 5 into "--resume-", which lands mid-token and reads as a selector context, so it received the selector list. Every other case in the file uses source.length. --- .../src/features/resume/stylesheet/editor-extensions.test.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/web/src/features/resume/stylesheet/editor-extensions.test.ts b/apps/web/src/features/resume/stylesheet/editor-extensions.test.ts index e23afe992..2400e1904 100644 --- a/apps/web/src/features/resume/stylesheet/editor-extensions.test.ts +++ b/apps/web/src/features/resume/stylesheet/editor-extensions.test.ts @@ -67,7 +67,9 @@ describe("Semantic CSS editor extensions", () => { const propertyLabels = await getSemanticCssCompletionLabels("section {\n\tco", 13, metadata); const variableSource = "resume { --brand-accent: #f00; color: var(--br"; const variableLabels = await getSemanticCssCompletionLabels(variableSource, variableSource.length, metadata); - const systemLabels = await getSemanticCssCompletionLabels("--resume-", 5, metadata); + // The cursor has to sit at the end of the typed prefix; mid-token it reads as a selector context. + const systemSource = "--resume-"; + const systemLabels = await getSemanticCssCompletionLabels(systemSource, systemSource.length, metadata); const directiveLabels = await getSemanticCssCompletionLabels("@", 1, metadata); expect(selectorLabels).toEqual(