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
Léo-Paul Géneau
gitlab-ce
Commits
de3194bf
Commit
de3194bf
authored
May 02, 2018
by
Kushal Pandya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Emit `toggleSubscription` event on component instead of eventHub
parent
c22a3fa0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
app/assets/javascripts/sidebar/components/subscriptions/subscriptions.vue
...cripts/sidebar/components/subscriptions/subscriptions.vue
+1
-2
spec/javascripts/sidebar/subscriptions_spec.js
spec/javascripts/sidebar/subscriptions_spec.js
+8
-0
No files found.
app/assets/javascripts/sidebar/components/subscriptions/subscriptions.vue
View file @
de3194bf
...
@@ -3,7 +3,6 @@
...
@@ -3,7 +3,6 @@
import
icon
from
'
~/vue_shared/components/icon.vue
'
;
import
icon
from
'
~/vue_shared/components/icon.vue
'
;
import
toggleButton
from
'
~/vue_shared/components/toggle_button.vue
'
;
import
toggleButton
from
'
~/vue_shared/components/toggle_button.vue
'
;
import
tooltip
from
'
~/vue_shared/directives/tooltip
'
;
import
tooltip
from
'
~/vue_shared/directives/tooltip
'
;
import
eventHub
from
'
../../event_hub
'
;
const
ICON_ON
=
'
notifications
'
;
const
ICON_ON
=
'
notifications
'
;
const
ICON_OFF
=
'
notifications-off
'
;
const
ICON_OFF
=
'
notifications-off
'
;
...
@@ -48,7 +47,7 @@
...
@@ -48,7 +47,7 @@
},
},
methods
:
{
methods
:
{
toggleSubscription
()
{
toggleSubscription
()
{
eventHub
.
$emit
(
'
toggleSubscription
'
,
this
.
id
);
this
.
$emit
(
'
toggleSubscription
'
,
this
.
id
);
},
},
},
},
};
};
...
...
spec/javascripts/sidebar/subscriptions_spec.js
View file @
de3194bf
...
@@ -39,4 +39,12 @@ describe('Subscriptions', function () {
...
@@ -39,4 +39,12 @@ describe('Subscriptions', function () {
expect
(
vm
.
$refs
.
toggleButton
.
$el
.
querySelector
(
'
.project-feature-toggle
'
)).
toHaveClass
(
'
is-checked
'
);
expect
(
vm
.
$refs
.
toggleButton
.
$el
.
querySelector
(
'
.project-feature-toggle
'
)).
toHaveClass
(
'
is-checked
'
);
});
});
it
(
'
toggleSubscription method emits `toggleSubscription` event on component
'
,
()
=>
{
vm
=
mountComponent
(
Subscriptions
,
{
subscribed
:
true
});
spyOn
(
vm
,
'
$emit
'
);
vm
.
toggleSubscription
();
expect
(
vm
.
$emit
).
toHaveBeenCalledWith
(
'
toggleSubscription
'
,
jasmine
.
any
(
Object
));
});
});
});
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