Commit 8abcb94f authored by jboyson's avatar jboyson

Update test ids to be kebab case

parent f33003a7
...@@ -204,7 +204,7 @@ export default { ...@@ -204,7 +204,7 @@ export default {
<template v-if="line.left && line.left.type !== $options.CONFLICT_MARKER"> <template v-if="line.left && line.left.type !== $options.CONFLICT_MARKER">
<div <div
:class="classNameMapCellLeft" :class="classNameMapCellLeft"
data-testid="leftLineNumber" data-testid="left-line-number"
class="diff-td diff-line-num" class="diff-td diff-line-num"
> >
<template v-if="!isLeftConflictMarker"> <template v-if="!isLeftConflictMarker">
...@@ -215,7 +215,7 @@ export default { ...@@ -215,7 +215,7 @@ export default {
:title="addCommentTooltipLeft" :title="addCommentTooltipLeft"
> >
<div <div
data-testid="leftCommentButton" data-testid="left-comment-button"
role="button" role="button"
tabindex="0" tabindex="0"
:draggable="!line.left.commentsDisabled && glFeatures.dragCommentSelection" :draggable="!line.left.commentsDisabled && glFeatures.dragCommentSelection"
...@@ -243,7 +243,7 @@ export default { ...@@ -243,7 +243,7 @@ export default {
v-if="line.hasDiscussionsLeft" v-if="line.hasDiscussionsLeft"
:discussions="line.left.discussions" :discussions="line.left.discussions"
:discussions-expanded="line.left.discussionsExpanded" :discussions-expanded="line.left.discussionsExpanded"
data-testid="leftDiscussions" data-testid="left-discussions"
@toggleLineDiscussions=" @toggleLineDiscussions="
toggleLineDiscussions({ toggleLineDiscussions({
lineCode: line.left.line_code, lineCode: line.left.line_code,
...@@ -273,7 +273,7 @@ export default { ...@@ -273,7 +273,7 @@ export default {
:key="line.left.line_code" :key="line.left.line_code"
:class="[parallelViewLeftLineType, { parallel: !inline }]" :class="[parallelViewLeftLineType, { parallel: !inline }]"
class="diff-td line_content with-coverage left-side" class="diff-td line_content with-coverage left-side"
data-testid="leftContent" data-testid="left-content"
@mousedown="handleParallelLineMouseDown" @mousedown="handleParallelLineMouseDown"
> >
<strong v-if="isLeftConflictMarker">{{ conflictText(line.left) }}</strong> <strong v-if="isLeftConflictMarker">{{ conflictText(line.left) }}</strong>
...@@ -282,7 +282,7 @@ export default { ...@@ -282,7 +282,7 @@ export default {
</template> </template>
<template v-else-if="!inline || (line.left && line.left.type === $options.CONFLICT_MARKER)"> <template v-else-if="!inline || (line.left && line.left.type === $options.CONFLICT_MARKER)">
<div <div
data-testid="leftEmptyCell" data-testid="left-empty-cell"
class="diff-td diff-line-num old_line empty-cell" class="diff-td diff-line-num old_line empty-cell"
:class="emptyCellLeftClassMap" :class="emptyCellLeftClassMap"
> >
...@@ -322,7 +322,7 @@ export default { ...@@ -322,7 +322,7 @@ export default {
:title="addCommentTooltipRight" :title="addCommentTooltipRight"
> >
<div <div
data-testid="rightCommentButton" data-testid="right-comment-button"
role="button" role="button"
tabindex="0" tabindex="0"
:draggable="!line.right.commentsDisabled && glFeatures.dragCommentSelection" :draggable="!line.right.commentsDisabled && glFeatures.dragCommentSelection"
...@@ -349,7 +349,7 @@ export default { ...@@ -349,7 +349,7 @@ export default {
v-if="line.hasDiscussionsRight" v-if="line.hasDiscussionsRight"
:discussions="line.right.discussions" :discussions="line.right.discussions"
:discussions-expanded="line.right.discussionsExpanded" :discussions-expanded="line.right.discussionsExpanded"
data-testid="rightDiscussions" data-testid="right-discussions"
@toggleLineDiscussions=" @toggleLineDiscussions="
toggleLineDiscussions({ toggleLineDiscussions({
lineCode: line.right.line_code, lineCode: line.right.line_code,
...@@ -391,7 +391,7 @@ export default { ...@@ -391,7 +391,7 @@ export default {
</template> </template>
<template v-else> <template v-else>
<div <div
data-testid="rightEmptyCell" data-testid="right-empty-cell"
class="diff-td diff-line-num old_line empty-cell" class="diff-td diff-line-num old_line empty-cell"
:class="emptyCellRightClassMap" :class="emptyCellRightClassMap"
></div> ></div>
......
...@@ -96,7 +96,8 @@ describe('DiffRow', () => { ...@@ -96,7 +96,8 @@ describe('DiffRow', () => {
expect(wrapper.vm.isHighlighted).toBe(false); expect(wrapper.vm.isHighlighted).toBe(false);
}); });
const getCommentButton = (wrapper, side) => wrapper.find(`[data-testid="${side}CommentButton"]`); const getCommentButton = (wrapper, side) =>
wrapper.find(`[data-testid="${side}-comment-button"]`);
describe.each` describe.each`
side side
...@@ -105,8 +106,8 @@ describe('DiffRow', () => { ...@@ -105,8 +106,8 @@ describe('DiffRow', () => {
`('$side side', ({ side }) => { `('$side side', ({ side }) => {
it(`renders empty cells if ${side} is unavailable`, () => { it(`renders empty cells if ${side} is unavailable`, () => {
const wrapper = createWrapper({ props: { line: testLines[2], inline: false } }); const wrapper = createWrapper({ props: { line: testLines[2], inline: false } });
expect(wrapper.find(`[data-testid="${side}LineNumber"]`).exists()).toBe(false); expect(wrapper.find(`[data-testid="${side}-line-number"]`).exists()).toBe(false);
expect(wrapper.find(`[data-testid="${side}EmptyCell"]`).exists()).toBe(true); expect(wrapper.find(`[data-testid="${side}-empty-cell"]`).exists()).toBe(true);
}); });
describe('comment button', () => { describe('comment button', () => {
...@@ -157,7 +158,7 @@ describe('DiffRow', () => { ...@@ -157,7 +158,7 @@ describe('DiffRow', () => {
it('renders avatars', () => { it('renders avatars', () => {
const wrapper = createWrapper({ props: { line: testLines[0], inline: false } }); const wrapper = createWrapper({ props: { line: testLines[0], inline: false } });
expect(wrapper.find(`[data-testid="${side}Discussions"]`).exists()).toBe(true); expect(wrapper.find(`[data-testid="${side}-discussions"]`).exists()).toBe(true);
}); });
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment