Skip to content

Commit 9b73675

Browse files
author
Jesse Haigh
committed
fix tests
1 parent aeda672 commit 9b73675

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

src/components/ContentNode/CodeListing.vue

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,13 @@
4141
v-for="(line, index) in syntaxHighlightedLines"
4242
><span
4343
:key="index"
44-
:class="['code-line-container',{ highlighted: isHighlighted(index),
45-
highlighted: isUserHighlighted(index),
46-
strikethrough: isUserStrikethrough(index),}]"
44+
:class="[
45+
'code-line-container',
46+
{
47+
highlighted: isHighlighted(index) || isUserHighlighted(index),
48+
strikethrough: isUserStrikethrough(index),
49+
}
50+
]"
4751
><span
4852
v-if="showLineNumbers"
4953
class="code-number"

tests/unit/components/ContentNode/CodeListing.spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ describe('CodeListing', () => {
128128
const codeLine = codeLineContainer.find('.code-line');
129129
expect(codeLine.text()).toBe(line);
130130

131-
expect(codeLineContainer.classes('user-highlighted')).toBe(shouldBeHighlighted);
131+
expect(codeLineContainer.classes('highlighted')).toBe(shouldBeHighlighted);
132132
});
133133
});
134134

@@ -163,7 +163,7 @@ describe('CodeListing', () => {
163163
const codeLine = codeLineContainer.find('.code-line');
164164
expect(codeLine.text()).toBe(line);
165165

166-
expect(codeLineContainer.classes('user-strikethrough')).toBe(shouldBeStriked);
166+
expect(codeLineContainer.classes('strikethrough')).toBe(shouldBeStriked);
167167
});
168168
});
169169

@@ -351,7 +351,7 @@ describe('CodeListing', () => {
351351

352352
await wrapper.setProps({ wrap: 0 });
353353
style = wrapper.attributes('style') || '';
354-
expect(style).toMatch(/--wrap-ch:\s*0\b/);
354+
expect(style === null || style === '').toBe(true);
355355
});
356356

357357
it('treats negative wrap as no-wrap', async () => {

0 commit comments

Comments
 (0)