Skip to content

Commit c8fc337

Browse files
test: assert the full confirmation titles instead of substrings
The two CodeLens confirmation tests used partial assertions: `includes('3.12.4')` and `!includes('(')`. Both are weak -- the first passes on any message that merely contains the version, and the second only asserts the absence of a character, so it verified nothing about the versionless text at all. Both now assert the complete localized title with assert.strictEqual. Confirmed load-bearing by mutation: renaming the message to "Script env ready" leaves both old assertions green while both new ones fail. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 9f6b241 commit c8fc337

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/test/features/inlineScript/codeLens.unit.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ suite('Inline script CodeLens provider', () => {
102102
const lenses = provider.provideCodeLenses(makeDocument(scriptUri), {} as never);
103103

104104
assert.strictEqual(lenses.length, 1);
105-
assert.ok(lenses[0].command?.title.includes('3.12.4'), lenses[0].command?.title);
105+
assert.strictEqual(lenses[0].command?.title, 'Script environment ready (Python 3.12.4)');
106106
assert.strictEqual(lenses[0].command?.command, '', 'the confirmation must not be clickable');
107107
});
108108

@@ -112,7 +112,7 @@ suite('Inline script CodeLens provider', () => {
112112
const lenses = provider.provideCodeLenses(makeDocument(scriptUri), {} as never);
113113

114114
assert.strictEqual(lenses.length, 1);
115-
assert.ok(!lenses[0].command?.title.includes('('), lenses[0].command?.title);
115+
assert.strictEqual(lenses[0].command?.title, 'Script environment ready');
116116
});
117117

118118
test('expires on its own and refreshes so the lens disappears', () => {

0 commit comments

Comments
 (0)