Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
4e65fe2f
Commit
4e65fe2f
authored
Dec 11, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed emoji awards not being added to notes
Closes
https://gitlab.com/gitlab-org/gitlab-ce/issues/55141
parent
185f8a5d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
1 deletion
+36
-1
app/assets/javascripts/notes/components/notes_app.vue
app/assets/javascripts/notes/components/notes_app.vue
+1
-1
spec/features/merge_request/user_awards_emoji_spec.rb
spec/features/merge_request/user_awards_emoji_spec.rb
+12
-0
spec/javascripts/notes/components/note_app_spec.js
spec/javascripts/notes/components/note_app_spec.js
+23
-0
No files found.
app/assets/javascripts/notes/components/notes_app.vue
View file @
4e65fe2f
...
@@ -102,7 +102,7 @@ export default {
...
@@ -102,7 +102,7 @@ export default {
if
(
parentElement
&&
parentElement
.
classList
.
contains
(
'
js-vue-notes-event
'
))
{
if
(
parentElement
&&
parentElement
.
classList
.
contains
(
'
js-vue-notes-event
'
))
{
parentElement
.
addEventListener
(
'
toggleAward
'
,
event
=>
{
parentElement
.
addEventListener
(
'
toggleAward
'
,
event
=>
{
const
{
awardName
,
noteId
}
=
event
.
detail
;
const
{
awardName
,
noteId
}
=
event
.
detail
;
this
.
actionT
oggleAward
({
awardName
,
noteId
});
this
.
t
oggleAward
({
awardName
,
noteId
});
});
});
}
}
},
},
...
...
spec/features/merge_request/user_awards_emoji_spec.rb
View file @
4e65fe2f
...
@@ -4,11 +4,14 @@ describe 'Merge request > User awards emoji', :js do
...
@@ -4,11 +4,14 @@ describe 'Merge request > User awards emoji', :js do
let
(
:project
)
{
create
(
:project
,
:public
,
:repository
)
}
let
(
:project
)
{
create
(
:project
,
:public
,
:repository
)
}
let
(
:user
)
{
project
.
creator
}
let
(
:user
)
{
project
.
creator
}
let
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project
,
author:
create
(
:user
))
}
let
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project
,
author:
create
(
:user
))
}
let!
(
:note
)
{
create
(
:note
,
noteable:
merge_request
,
project:
merge_request
.
project
)
}
describe
'logged in'
do
describe
'logged in'
do
before
do
before
do
sign_in
(
user
)
sign_in
(
user
)
visit
project_merge_request_path
(
project
,
merge_request
)
visit
project_merge_request_path
(
project
,
merge_request
)
wait_for_requests
end
end
it
'adds award to merge request'
do
it
'adds award to merge request'
do
...
@@ -36,6 +39,15 @@ describe 'Merge request > User awards emoji', :js do
...
@@ -36,6 +39,15 @@ describe 'Merge request > User awards emoji', :js do
expect
(
page
).
to
have_selector
(
'.emoji-menu'
,
count:
1
)
expect
(
page
).
to
have_selector
(
'.emoji-menu'
,
count:
1
)
end
end
it
'adds awards to note'
do
first
(
'.js-note-emoji'
).
click
first
(
'.emoji-menu .js-emoji-btn'
).
click
wait_for_requests
expect
(
page
).
to
have_selector
(
'.js-awards-block'
)
end
describe
'the project is archived'
do
describe
'the project is archived'
do
let
(
:project
)
{
create
(
:project
,
:public
,
:repository
,
:archived
)
}
let
(
:project
)
{
create
(
:project
,
:public
,
:repository
,
:archived
)
}
...
...
spec/javascripts/notes/components/note_app_spec.js
View file @
4e65fe2f
...
@@ -30,6 +30,8 @@ describe('note_app', () => {
...
@@ -30,6 +30,8 @@ describe('note_app', () => {
jasmine
.
addMatchers
(
vueMatchers
);
jasmine
.
addMatchers
(
vueMatchers
);
$
(
'
body
'
).
attr
(
'
data-page
'
,
'
projects:merge_requests:show
'
);
$
(
'
body
'
).
attr
(
'
data-page
'
,
'
projects:merge_requests:show
'
);
setFixtures
(
'
<div class="js-vue-notes-event"><div id="app"></div></div>
'
);
const
IssueNotesApp
=
Vue
.
extend
(
notesApp
);
const
IssueNotesApp
=
Vue
.
extend
(
notesApp
);
store
=
createStore
();
store
=
createStore
();
...
@@ -43,6 +45,7 @@ describe('note_app', () => {
...
@@ -43,6 +45,7 @@ describe('note_app', () => {
return
mountComponentWithStore
(
IssueNotesApp
,
{
return
mountComponentWithStore
(
IssueNotesApp
,
{
props
,
props
,
store
,
store
,
el
:
document
.
getElementById
(
'
app
'
),
});
});
};
};
});
});
...
@@ -283,4 +286,24 @@ describe('note_app', () => {
...
@@ -283,4 +286,24 @@ describe('note_app', () => {
},
0
);
},
0
);
});
});
});
});
describe
(
'
emoji awards
'
,
()
=>
{
it
(
'
dispatches toggleAward after toggleAward event
'
,
()
=>
{
const
toggleAwardEvent
=
new
CustomEvent
(
'
toggleAward
'
,
{
detail
:
{
awardName
:
'
test
'
,
noteId
:
1
,
},
});
spyOn
(
vm
.
$store
,
'
dispatch
'
);
vm
.
$el
.
parentElement
.
dispatchEvent
(
toggleAwardEvent
);
expect
(
vm
.
$store
.
dispatch
).
toHaveBeenCalledWith
(
'
toggleAward
'
,
{
awardName
:
'
test
'
,
noteId
:
1
,
});
});
});
});
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment