Skip to content

Commit 2cd0275

Browse files
author
Jesse Haigh
committed
fix tests
1 parent 530995c commit 2cd0275

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
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"

src/components/Tutorial/CodeTheme.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ export default {
8484
'--text': codeColors.text,
8585
'--background': codeColors.background,
8686
'--line-highlight': codeColors.lineHighlight,
87-
'--user-line-highlight': codeColors.userLineHighlight,
8887
'--url': codeColors.commentURL,
8988
'--syntax-comment': codeColors.comment,
9089
'--syntax-quote': codeColors.comment,

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

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

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

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

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

@@ -352,7 +352,7 @@ describe('CodeListing', () => {
352352

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

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

0 commit comments

Comments
 (0)