Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
44a0121a
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
44a0121a
编写于
11月 30, 2018
作者:
S
Sam Bigelow
提交者:
Phil Hughes
11月 30, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Resolve "Merge request refactor does not highlight selected line"
上级
0d5cbd16
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
288 addition
and
12 deletion
+288
-12
app/assets/javascripts/diffs/components/app.vue
app/assets/javascripts/diffs/components/app.vue
+7
-0
app/assets/javascripts/diffs/components/diff_line_gutter_content.vue
...javascripts/diffs/components/diff_line_gutter_content.vue
+15
-2
app/assets/javascripts/diffs/components/diff_table_cell.vue
app/assets/javascripts/diffs/components/diff_table_cell.vue
+8
-1
app/assets/javascripts/diffs/components/inline_diff_table_row.vue
...ts/javascripts/diffs/components/inline_diff_table_row.vue
+18
-2
app/assets/javascripts/diffs/components/parallel_diff_table_row.vue
.../javascripts/diffs/components/parallel_diff_table_row.vue
+26
-3
app/assets/javascripts/diffs/store/actions.js
app/assets/javascripts/diffs/store/actions.js
+6
-2
app/assets/javascripts/diffs/store/modules/diff_state.js
app/assets/javascripts/diffs/store/modules/diff_state.js
+1
-0
app/assets/javascripts/diffs/store/mutation_types.js
app/assets/javascripts/diffs/store/mutation_types.js
+1
-0
app/assets/javascripts/diffs/store/mutations.js
app/assets/javascripts/diffs/store/mutations.js
+3
-0
changelogs/unreleased/48496-merge-request-refactor-does-not-highlight-selected-line.yml
...rge-request-refactor-does-not-highlight-selected-line.yml
+5
-0
spec/javascripts/diffs/components/app_spec.js
spec/javascripts/diffs/components/app_spec.js
+13
-0
spec/javascripts/diffs/components/diff_table_cell_spec.js
spec/javascripts/diffs/components/diff_table_cell_spec.js
+37
-0
spec/javascripts/diffs/components/inline_diff_table_row_spec.js
...avascripts/diffs/components/inline_diff_table_row_spec.js
+42
-0
spec/javascripts/diffs/components/parallel_diff_table_row_spec.js
...ascripts/diffs/components/parallel_diff_table_row_spec.js
+85
-0
spec/javascripts/diffs/store/actions_spec.js
spec/javascripts/diffs/store/actions_spec.js
+11
-2
spec/javascripts/diffs/store/mutations_spec.js
spec/javascripts/diffs/store/mutations_spec.js
+10
-0
未找到文件。
app/assets/javascripts/diffs/components/app.vue
浏览文件 @
44a0121a
...
...
@@ -102,6 +102,12 @@ export default {
if
(
this
.
shouldShow
)
{
this
.
fetchData
();
}
const
id
=
window
&&
window
.
location
&&
window
.
location
.
hash
;
if
(
id
)
{
this
.
setHighlightedRow
(
id
.
slice
(
1
));
}
},
created
()
{
this
.
adjustView
();
...
...
@@ -114,6 +120,7 @@ export default {
'
fetchDiffFiles
'
,
'
startRenderDiffsQueue
'
,
'
assignDiscussionsToDiff
'
,
'
setHighlightedRow
'
,
]),
fetchData
()
{
this
.
fetchDiffFiles
()
...
...
app/assets/javascripts/diffs/components/diff_line_gutter_content.vue
浏览文件 @
44a0121a
...
...
@@ -72,6 +72,13 @@ export default {
diffFiles
:
state
=>
state
.
diffs
.
diffFiles
,
}),
...
mapGetters
([
'
isLoggedIn
'
]),
lineCode
()
{
return
(
this
.
line
.
line_code
||
(
this
.
line
.
left
&&
this
.
line
.
line
.
left
.
line_code
)
||
(
this
.
line
.
right
&&
this
.
line
.
right
.
line_code
)
);
},
lineHref
()
{
return
`#
${
this
.
line
.
line_code
||
''
}
`
;
},
...
...
@@ -97,7 +104,7 @@ export default {
},
},
methods
:
{
...
mapActions
(
'
diffs
'
,
[
'
loadMoreLines
'
,
'
showCommentForm
'
]),
...
mapActions
(
'
diffs
'
,
[
'
loadMoreLines
'
,
'
showCommentForm
'
,
'
setHighlightedRow
'
]),
handleCommentButton
()
{
this
.
showCommentForm
({
lineCode
:
this
.
line
.
line_code
,
fileHash
:
this
.
fileHash
});
},
...
...
@@ -168,7 +175,13 @@ export default {
>
<icon
:size=
"12"
name=
"comment"
/>
</button>
<a
v-if=
"lineNumber"
:data-linenumber=
"lineNumber"
:href=
"lineHref"
>
</a>
<a
v-if=
"lineNumber"
:data-linenumber=
"lineNumber"
:href=
"lineHref"
@
click=
"setHighlightedRow(lineCode);"
>
</a>
<diff-gutter-avatars
v-if=
"shouldShowAvatarsOnGutter"
:discussions=
"line.discussions"
/>
</
template
>
</div>
...
...
app/assets/javascripts/diffs/components/diff_table_cell.vue
浏览文件 @
44a0121a
<
script
>
import
{
mapGetters
}
from
'
vuex
'
;
import
{
mapGetters
,
mapActions
}
from
'
vuex
'
;
import
DiffLineGutterContent
from
'
./diff_line_gutter_content.vue
'
;
import
{
MATCH_LINE_TYPE
,
...
...
@@ -30,6 +30,11 @@ export default {
type
:
String
,
required
:
true
,
},
isHighlighted
:
{
type
:
Boolean
,
required
:
true
,
default
:
false
,
},
diffViewType
:
{
type
:
String
,
required
:
false
,
...
...
@@ -85,6 +90,7 @@ export default {
const
{
type
}
=
this
.
line
;
return
{
hll
:
this
.
isHighlighted
,
[
type
]:
type
,
[
LINE_UNFOLD_CLASS_NAME
]:
this
.
isMatchLine
,
[
LINE_HOVER_CLASS_NAME
]:
...
...
@@ -99,6 +105,7 @@ export default {
return
this
.
lineType
===
OLD_LINE_TYPE
?
this
.
line
.
old_line
:
this
.
line
.
new_line
;
},
},
methods
:
mapActions
(
'
diffs
'
,
[
'
setHighlightedRow
'
]),
};
</
script
>
...
...
app/assets/javascripts/diffs/components/inline_diff_table_row.vue
浏览文件 @
44a0121a
<
script
>
import
{
mapGetters
,
mapActions
}
from
'
vuex
'
;
import
{
mapGetters
,
mapActions
,
mapState
}
from
'
vuex
'
;
import
DiffTableCell
from
'
./diff_table_cell.vue
'
;
import
{
NEW_LINE_TYPE
,
...
...
@@ -40,6 +40,11 @@ export default {
};
},
computed
:
{
...
mapState
({
isHighlighted
(
state
)
{
return
this
.
line
.
line_code
!==
null
&&
this
.
line
.
line_code
===
state
.
diffs
.
highlightedRow
;
},
}),
...
mapGetters
(
'
diffs
'
,
[
'
isInlineView
'
]),
isContextLine
()
{
return
this
.
line
.
type
===
CONTEXT_LINE_TYPE
;
...
...
@@ -91,6 +96,7 @@ export default {
:is-bottom=
"isBottom"
:is-hover=
"isHover"
:show-comment-button=
"true"
:is-highlighted=
"isHighlighted"
class=
"diff-line-num old_line"
/>
<diff-table-cell
...
...
@@ -100,8 +106,18 @@ export default {
:line-type=
"newLineType"
:is-bottom=
"isBottom"
:is-hover=
"isHover"
:is-highlighted=
"isHighlighted"
class=
"diff-line-num new_line qa-new-diff-line"
/>
<td
:class=
"line.type"
class=
"line_content"
v-html=
"line.rich_text"
></td>
<td
:class=
"[
line.type,
{
hll: isHighlighted,
},
]"
class="line_content"
v-html="line.rich_text"
>
</td>
</tr>
</
template
>
app/assets/javascripts/diffs/components/parallel_diff_table_row.vue
浏览文件 @
44a0121a
<
script
>
import
{
mapActions
}
from
'
vuex
'
;
import
{
mapActions
,
mapState
}
from
'
vuex
'
;
import
$
from
'
jquery
'
;
import
DiffTableCell
from
'
./diff_table_cell.vue
'
;
import
{
...
...
@@ -43,6 +43,15 @@ export default {
};
},
computed
:
{
...
mapState
({
isHighlighted
(
state
)
{
const
lineCode
=
(
this
.
line
.
left
&&
this
.
line
.
left
.
line_code
)
||
(
this
.
line
.
right
&&
this
.
line
.
right
.
line_code
);
return
lineCode
?
lineCode
===
state
.
diffs
.
highlightedRow
:
false
;
},
}),
isContextLine
()
{
return
this
.
line
.
left
&&
this
.
line
.
left
.
type
===
CONTEXT_LINE_TYPE
;
},
...
...
@@ -57,7 +66,14 @@ export default {
return
OLD_NO_NEW_LINE_TYPE
;
}
return
this
.
line
.
left
?
this
.
line
.
left
.
type
:
EMPTY_CELL_TYPE
;
const
lineTypeClass
=
this
.
line
.
left
?
this
.
line
.
left
.
type
:
EMPTY_CELL_TYPE
;
return
[
lineTypeClass
,
{
hll
:
this
.
isHighlighted
,
},
];
},
},
created
()
{
...
...
@@ -114,6 +130,7 @@ export default {
:line-type=
"oldLineType"
:is-bottom=
"isBottom"
:is-hover=
"isLeftHover"
:is-highlighted=
"isHighlighted"
:show-comment-button=
"true"
:diff-view-type=
"parallelDiffViewType"
line-position=
"left"
...
...
@@ -139,6 +156,7 @@ export default {
:line-type=
"newLineType"
:is-bottom=
"isBottom"
:is-hover=
"isRightHover"
:is-highlighted=
"isHighlighted"
:show-comment-button=
"true"
:diff-view-type=
"parallelDiffViewType"
line-position=
"right"
...
...
@@ -146,7 +164,12 @@ export default {
/>
<td
:id=
"line.right.line_code"
:class=
"line.right.type"
:class=
"[
line.right.type,
{
hll: isHighlighted,
},
]"
class="line_content parallel right-side"
@mousedown.native="handleParallelLineMouseDown"
v-html="line.right.rich_text"
...
...
app/assets/javascripts/diffs/store/actions.js
浏览文件 @
44a0121a
...
...
@@ -33,6 +33,10 @@ export const fetchDiffFiles = ({ state, commit }) => {
.
then
(
handleLocationHash
);
};
export
const
setHighlightedRow
=
({
commit
},
lineCode
)
=>
{
commit
(
types
.
SET_HIGHLIGHTED_ROW
,
lineCode
);
};
// This is adding line discussions to the actual lines in the diff tree
// once for parallel and once for inline mode
export
const
assignDiscussionsToDiff
=
(
...
...
@@ -127,7 +131,7 @@ export const loadMoreLines = ({ commit }, options) => {
export
const
scrollToLineIfNeededInline
=
(
_
,
line
)
=>
{
const
hash
=
getLocationHash
();
if
(
hash
&&
line
.
line
C
ode
===
hash
)
{
if
(
hash
&&
line
.
line
_c
ode
===
hash
)
{
handleLocationHash
();
}
};
...
...
@@ -137,7 +141,7 @@ export const scrollToLineIfNeededParallel = (_, line) => {
if
(
hash
&&
((
line
.
left
&&
line
.
left
.
line
Code
===
hash
)
||
(
line
.
right
&&
line
.
right
.
lineC
ode
===
hash
))
((
line
.
left
&&
line
.
left
.
line
_code
===
hash
)
||
(
line
.
right
&&
line
.
right
.
line_c
ode
===
hash
))
)
{
handleLocationHash
();
}
...
...
app/assets/javascripts/diffs/store/modules/diff_state.js
浏览文件 @
44a0121a
...
...
@@ -26,4 +26,5 @@ export default () => ({
currentDiffFileId
:
''
,
projectPath
:
''
,
commentForms
:
[],
highlightedRow
:
null
,
});
app/assets/javascripts/diffs/store/mutation_types.js
浏览文件 @
44a0121a
...
...
@@ -17,3 +17,4 @@ export const UPDATE_CURRENT_DIFF_FILE_ID = 'UPDATE_CURRENT_DIFF_FILE_ID';
export
const
OPEN_DIFF_FILE_COMMENT_FORM
=
'
OPEN_DIFF_FILE_COMMENT_FORM
'
;
export
const
UPDATE_DIFF_FILE_COMMENT_FORM
=
'
UPDATE_DIFF_FILE_COMMENT_FORM
'
;
export
const
CLOSE_DIFF_FILE_COMMENT_FORM
=
'
CLOSE_DIFF_FILE_COMMENT_FORM
'
;
export
const
SET_HIGHLIGHTED_ROW
=
'
SET_HIGHLIGHTED_ROW
'
;
app/assets/javascripts/diffs/store/mutations.js
浏览文件 @
44a0121a
...
...
@@ -241,4 +241,7 @@ export default {
[
types
.
CLOSE_DIFF_FILE_COMMENT_FORM
](
state
,
fileHash
)
{
state
.
commentForms
=
state
.
commentForms
.
filter
(
form
=>
form
.
fileHash
!==
fileHash
);
},
[
types
.
SET_HIGHLIGHTED_ROW
](
state
,
lineCode
)
{
state
.
highlightedRow
=
lineCode
;
},
};
changelogs/unreleased/48496-merge-request-refactor-does-not-highlight-selected-line.yml
0 → 100644
浏览文件 @
44a0121a
---
title
:
When user clicks linenumber in MR changes, highlight that line
merge_request
:
author
:
type
:
fixed
spec/javascripts/diffs/components/app_spec.js
浏览文件 @
44a0121a
...
...
@@ -13,6 +13,8 @@ describe('diffs/components/app', () => {
beforeEach
(()
=>
{
// setup globals (needed for component to mount :/)
window
.
mrTabs
=
jasmine
.
createSpyObj
(
'
mrTabs
'
,
[
'
resetViewContainer
'
]);
window
.
mrTabs
.
expandViewContainer
=
jasmine
.
createSpy
();
window
.
location
.
hash
=
'
ABC_123
'
;
// setup component
const
store
=
createDiffsStore
();
...
...
@@ -39,4 +41,15 @@ describe('diffs/components/app', () => {
it
(
'
does not show commit info
'
,
()
=>
{
expect
(
vm
.
$el
).
not
.
toContainElement
(
'
.blob-commit-info
'
);
});
it
(
'
sets highlighted row if hash exists in location object
'
,
done
=>
{
vm
.
$props
.
shouldShow
=
true
;
vm
.
$nextTick
()
.
then
(()
=>
{
expect
(
vm
.
$store
.
state
.
diffs
.
highlightedRow
).
toBe
(
'
ABC_123
'
);
})
.
then
(
done
)
.
catch
(
done
.
fail
);
});
});
spec/javascripts/diffs/components/diff_table_cell_spec.js
0 → 100644
浏览文件 @
44a0121a
import
Vue
from
'
vue
'
;
import
store
from
'
~/mr_notes/stores
'
;
import
DiffTableCell
from
'
~/diffs/components/diff_table_cell.vue
'
;
import
{
createComponentWithStore
}
from
'
spec/helpers/vue_mount_component_helper
'
;
import
diffFileMockData
from
'
../mock_data/diff_file
'
;
describe
(
'
DiffTableCell
'
,
()
=>
{
const
createComponent
=
options
=>
createComponentWithStore
(
Vue
.
extend
(
DiffTableCell
),
store
,
{
line
:
diffFileMockData
.
highlighted_diff_lines
[
0
],
fileHash
:
diffFileMockData
.
file_hash
,
contextLinesPath
:
'
contextLinesPath
'
,
...
options
,
}).
$mount
();
it
(
'
does not highlight row when isHighlighted prop is false
'
,
done
=>
{
const
vm
=
createComponent
({
isHighlighted
:
false
});
vm
.
$nextTick
()
.
then
(()
=>
{
expect
(
vm
.
$el
.
classList
).
not
.
toContain
(
'
hll
'
);
})
.
then
(
done
)
.
catch
(
done
.
fail
);
});
it
(
'
highlights row when isHighlighted prop is true
'
,
done
=>
{
const
vm
=
createComponent
({
isHighlighted
:
true
});
vm
.
$nextTick
()
.
then
(()
=>
{
expect
(
vm
.
$el
.
classList
).
toContain
(
'
hll
'
);
})
.
then
(
done
)
.
catch
(
done
.
fail
);
});
});
spec/javascripts/diffs/components/inline_diff_table_row_spec.js
0 → 100644
浏览文件 @
44a0121a
import
Vue
from
'
vue
'
;
import
store
from
'
~/mr_notes/stores
'
;
import
InlineDiffTableRow
from
'
~/diffs/components/inline_diff_table_row.vue
'
;
import
{
createComponentWithStore
}
from
'
spec/helpers/vue_mount_component_helper
'
;
import
diffFileMockData
from
'
../mock_data/diff_file
'
;
describe
(
'
InlineDiffTableRow
'
,
()
=>
{
let
vm
;
const
thisLine
=
diffFileMockData
.
highlighted_diff_lines
[
0
];
beforeEach
(()
=>
{
vm
=
createComponentWithStore
(
Vue
.
extend
(
InlineDiffTableRow
),
store
,
{
line
:
thisLine
,
fileHash
:
diffFileMockData
.
file_hash
,
contextLinesPath
:
'
contextLinesPath
'
,
isHighlighted
:
false
,
}).
$mount
();
});
it
(
'
does not add hll class to line content when line does not match highlighted row
'
,
done
=>
{
vm
.
$nextTick
()
.
then
(()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.line_content
'
).
classList
).
not
.
toContain
(
'
hll
'
);
})
.
then
(
done
)
.
catch
(
done
.
fail
);
});
it
(
'
adds hll class to lineContent when line is the highlighted row
'
,
done
=>
{
vm
.
$nextTick
()
.
then
(()
=>
{
vm
.
$store
.
state
.
diffs
.
highlightedRow
=
thisLine
.
line_code
;
return
vm
.
$nextTick
();
})
.
then
(()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.line_content
'
).
classList
).
toContain
(
'
hll
'
);
})
.
then
(
done
)
.
catch
(
done
.
fail
);
});
});
spec/javascripts/diffs/components/parallel_diff_table_row_spec.js
0 → 100644
浏览文件 @
44a0121a
import
Vue
from
'
vue
'
;
import
{
createStore
}
from
'
~/mr_notes/stores
'
;
import
ParallelDiffTableRow
from
'
~/diffs/components/parallel_diff_table_row.vue
'
;
import
{
createComponentWithStore
}
from
'
spec/helpers/vue_mount_component_helper
'
;
import
diffFileMockData
from
'
../mock_data/diff_file
'
;
describe
(
'
ParallelDiffTableRow
'
,
()
=>
{
describe
(
'
when one side is empty
'
,
()
=>
{
let
vm
;
const
thisLine
=
diffFileMockData
.
parallel_diff_lines
[
0
];
const
rightLine
=
diffFileMockData
.
parallel_diff_lines
[
0
].
right
;
beforeEach
(()
=>
{
vm
=
createComponentWithStore
(
Vue
.
extend
(
ParallelDiffTableRow
),
createStore
(),
{
line
:
thisLine
,
fileHash
:
diffFileMockData
.
file_hash
,
contextLinesPath
:
'
contextLinesPath
'
,
isHighlighted
:
false
,
}).
$mount
();
});
it
(
'
does not highlight non empty line content when line does not match highlighted row
'
,
done
=>
{
vm
.
$nextTick
()
.
then
(()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.line_content.right-side
'
).
classList
).
not
.
toContain
(
'
hll
'
);
})
.
then
(
done
)
.
catch
(
done
.
fail
);
});
it
(
'
highlights nonempty line content when line is the highlighted row
'
,
done
=>
{
vm
.
$nextTick
()
.
then
(()
=>
{
vm
.
$store
.
state
.
diffs
.
highlightedRow
=
rightLine
.
line_code
;
return
vm
.
$nextTick
();
})
.
then
(()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.line_content.right-side
'
).
classList
).
toContain
(
'
hll
'
);
})
.
then
(
done
)
.
catch
(
done
.
fail
);
});
});
describe
(
'
when both sides have content
'
,
()
=>
{
let
vm
;
const
thisLine
=
diffFileMockData
.
parallel_diff_lines
[
2
];
const
rightLine
=
diffFileMockData
.
parallel_diff_lines
[
2
].
right
;
beforeEach
(()
=>
{
vm
=
createComponentWithStore
(
Vue
.
extend
(
ParallelDiffTableRow
),
createStore
(),
{
line
:
thisLine
,
fileHash
:
diffFileMockData
.
file_hash
,
contextLinesPath
:
'
contextLinesPath
'
,
isHighlighted
:
false
,
}).
$mount
();
});
it
(
'
does not highlight either line when line does not match highlighted row
'
,
done
=>
{
vm
.
$nextTick
()
.
then
(()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.line_content.right-side
'
).
classList
).
not
.
toContain
(
'
hll
'
);
expect
(
vm
.
$el
.
querySelector
(
'
.line_content.left-side
'
).
classList
).
not
.
toContain
(
'
hll
'
);
})
.
then
(
done
)
.
catch
(
done
.
fail
);
});
it
(
'
adds hll class to lineContent when line is the highlighted row
'
,
done
=>
{
vm
.
$nextTick
()
.
then
(()
=>
{
vm
.
$store
.
state
.
diffs
.
highlightedRow
=
rightLine
.
line_code
;
return
vm
.
$nextTick
();
})
.
then
(()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.line_content.right-side
'
).
classList
).
toContain
(
'
hll
'
);
expect
(
vm
.
$el
.
querySelector
(
'
.line_content.left-side
'
).
classList
).
toContain
(
'
hll
'
);
})
.
then
(
done
)
.
catch
(
done
.
fail
);
});
});
});
spec/javascripts/diffs/store/actions_spec.js
浏览文件 @
44a0121a
...
...
@@ -22,6 +22,7 @@ import actions, {
expandAllFiles
,
toggleFileDiscussions
,
saveDiffDiscussion
,
setHighlightedRow
,
toggleTreeOpen
,
scrollToFile
,
toggleShowTreeList
,
...
...
@@ -92,6 +93,14 @@ describe('DiffsStoreActions', () => {
});
});
describe
(
'
setHighlightedRow
'
,
()
=>
{
it
(
'
should set lineHash and fileHash of highlightedRow
'
,
()
=>
{
testAction
(
setHighlightedRow
,
'
ABC_123
'
,
{},
[
{
type
:
types
.
SET_HIGHLIGHTED_ROW
,
payload
:
'
ABC_123
'
},
]);
});
});
describe
(
'
assignDiscussionsToDiff
'
,
()
=>
{
it
(
'
should merge discussions into diffs
'
,
done
=>
{
const
state
=
{
...
...
@@ -469,7 +478,7 @@ describe('DiffsStoreActions', () => {
describe
(
'
scrollToLineIfNeededInline
'
,
()
=>
{
const
lineMock
=
{
line
C
ode
:
'
ABC_123
'
,
line
_c
ode
:
'
ABC_123
'
,
};
it
(
'
should not call handleLocationHash when there is not hash
'
,
()
=>
{
...
...
@@ -520,7 +529,7 @@ describe('DiffsStoreActions', () => {
const
lineMock
=
{
left
:
null
,
right
:
{
line
C
ode
:
'
ABC_123
'
,
line
_c
ode
:
'
ABC_123
'
,
},
};
...
...
spec/javascripts/diffs/store/mutations_spec.js
浏览文件 @
44a0121a
...
...
@@ -360,6 +360,16 @@ describe('DiffsStoreMutations', () => {
});
});
describe
(
'
Set highlighted row
'
,
()
=>
{
it
(
'
sets highlighted row
'
,
()
=>
{
const
state
=
createState
();
mutations
[
types
.
SET_HIGHLIGHTED_ROW
](
state
,
'
ABC_123
'
);
expect
(
state
.
highlightedRow
).
toBe
(
'
ABC_123
'
);
});
});
describe
(
'
TOGGLE_LINE_HAS_FORM
'
,
()
=>
{
it
(
'
sets hasForm on lines
'
,
()
=>
{
const
file
=
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录