summaryrefslogtreecommitdiff
path: root/spec/javascripts/shortcuts_dashboard_navigation_spec.js
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2018-05-04 14:58:47 +0100
committerFilipa Lacerda <filipa@gitlab.com>2018-05-04 14:58:47 +0100
commit1983356d647290fe38ca21bbbca43fe2d6292913 (patch)
treed07fba5693e239993dfc6d1f724b2103f90a3fa6 /spec/javascripts/shortcuts_dashboard_navigation_spec.js
parent703f45632292e7fc45359d0144cd616725bf9b0d (diff)
parent4bf47cd76fd69a26b7b2b4ac029f088ec5493712 (diff)
downloadgitlab-ce-1983356d647290fe38ca21bbbca43fe2d6292913.tar.gz
Merge branch 'master' into 44427-state-management-with-vuext
* master: (1063 commits) Replace commits spinach tests with RSpec analog Update repository.rb Add note about rebase/squash duplication in Gitaly Resolve "Reconcile project templates with Auto DevOps" Move import project pane to a separate partial Inform the user when there are no project import options available Clarify location of Vue templates Make add_index_to_namespaces_runners_token migration reversible Fix lambda arguments in Grape entities Update grape-entity 0.6.0 -> 0.7.1 Fix constants in backfill_runner_type_for_ci_runners_post_migrate.rb Use limited_counter_with_delimiter in the admin user list tabs Remove a warning from spec/features/admin/admin_users_spec.rb Use smallint for runner_type since its an enum Dont remove duplicates in Runner.owned_or_shared since its not necessary Change the docs license to CC BY-SA Remove unnecessary disable transaction in add_ci_runner_namespaces Split migration to add and index namespaces.runners_token Output some useful information when running the rails console Revert "Use factory in specs for ProjectCiCdSettings" ...
Diffstat (limited to 'spec/javascripts/shortcuts_dashboard_navigation_spec.js')
-rw-r--r--spec/javascripts/shortcuts_dashboard_navigation_spec.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/javascripts/shortcuts_dashboard_navigation_spec.js b/spec/javascripts/shortcuts_dashboard_navigation_spec.js
new file mode 100644
index 00000000000..7cb201e01d8
--- /dev/null
+++ b/spec/javascripts/shortcuts_dashboard_navigation_spec.js
@@ -0,0 +1,23 @@
+import findAndFollowLink from '~/shortcuts_dashboard_navigation';
+
+describe('findAndFollowLink', () => {
+ it('visits a link when the selector exists', () => {
+ const href = '/some/path';
+ const visitUrl = spyOnDependency(findAndFollowLink, 'visitUrl');
+
+ setFixtures(`<a class="my-shortcut" href="${href}">link</a>`);
+
+ findAndFollowLink('.my-shortcut');
+
+ expect(visitUrl).toHaveBeenCalledWith(href);
+ });
+
+ it('does not throw an exception when the selector does not exist', () => {
+ const visitUrl = spyOnDependency(findAndFollowLink, 'visitUrl');
+
+ // this should not throw an exception
+ findAndFollowLink('.this-selector-does-not-exist');
+
+ expect(visitUrl).not.toHaveBeenCalled();
+ });
+});