diff --git a/src/core_plugins/tests_bundle/tests_entry_template.js b/src/core_plugins/tests_bundle/tests_entry_template.js index 78529335daef1..f98477b407524 100644 --- a/src/core_plugins/tests_bundle/tests_entry_template.js +++ b/src/core_plugins/tests_bundle/tests_entry_template.js @@ -81,6 +81,10 @@ new CoreSystem({ enableExternalUrls: true }, uiCapabilities: { + navLinks: { + myLink: true, + notMyLink: true, + }, discover: { showWriteControls: true }, diff --git a/src/ui/public/chrome/directives/global_nav/app_switcher/__tests__/app_switcher.js b/src/ui/public/chrome/directives/global_nav/app_switcher/__tests__/app_switcher.js index dbb5efe1b06c6..c50bfa7129124 100644 --- a/src/ui/public/chrome/directives/global_nav/app_switcher/__tests__/app_switcher.js +++ b/src/ui/public/chrome/directives/global_nav/app_switcher/__tests__/app_switcher.js @@ -65,6 +65,7 @@ describe('appSwitcher directive', function () { const myLink = { active: true, title: 'myLink', + id: 'myLink', url: 'http://localhost:555/app/myApp', lastSubUrl: 'http://localhost:555/app/myApp#/lastSubUrl' }; @@ -72,6 +73,7 @@ describe('appSwitcher directive', function () { const notMyLink = { active: false, title: 'notMyLink', + id: 'notMyLink', url: 'http://localhost:555/app/notMyApp', lastSubUrl: 'http://localhost:555/app/notMyApp#/lastSubUrl' }; @@ -95,6 +97,7 @@ describe('appSwitcher directive', function () { const myLink = { active: false, title: 'myLink', + id: 'myLink', url: 'http://localhost:555/app/myApp', lastSubUrl: 'http://localhost:555/app/myApp#/lastSubUrl' }; @@ -102,6 +105,7 @@ describe('appSwitcher directive', function () { const notMyLink = { active: false, title: 'notMyLink', + id: 'notMyLink', url: 'http://localhost:555/app/notMyApp', lastSubUrl: 'http://localhost:555/app/notMyApp#/lastSubUrl' }; @@ -124,7 +128,7 @@ describe('appSwitcher directive', function () { describe('clicking a link with matching href but missing hash', function () { const url = 'http://localhost:555/app/myApp?query=1'; beforeEach(setup(url + '#/lastSubUrl', [ - { url: url } + { url: url, id: 'myLink' } ])); it('just prevents propagation (no reload)', function () { @@ -147,7 +151,7 @@ describe('appSwitcher directive', function () { describe('clicking a link that matches entire url', function () { const url = 'http://localhost:555/app/myApp#/lastSubUrl'; beforeEach(setup(url, [ - { url: url } + { url: url, id: 'myLink' } ])); it('calls window.location.reload and prevents propagation', function () { @@ -172,7 +176,7 @@ describe('appSwitcher directive', function () { const url = rootUrl + '#/lastSubUrl2'; beforeEach(setup(url + '#/lastSubUrl', [ - { url: url } + { url: url, id: 'myLink' } ])); it('calls window.location.reload and prevents propagation', function () { @@ -195,6 +199,7 @@ describe('appSwitcher directive', function () { describe('clicking a link with matching host', function () { beforeEach(setup('http://localhost:555/someOtherPath', [ { + id: 'myLink', active: true, url: 'http://localhost:555/app/myApp' } @@ -216,6 +221,7 @@ describe('appSwitcher directive', function () { describe('clicking a link with matching host and path', function () { beforeEach(setup('http://localhost:555/app/myApp?someQuery=true', [ { + id: 'myLink', active: true, url: 'http://localhost:555/app/myApp?differentQuery=true' } diff --git a/x-pack/plugins/spaces/server/lib/toggle_ui_capabilities.test.ts b/x-pack/plugins/spaces/server/lib/toggle_ui_capabilities.test.ts deleted file mode 100644 index a6b3796bf9424..0000000000000 --- a/x-pack/plugins/spaces/server/lib/toggle_ui_capabilities.test.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -describe('toggleUiCapabilities', () => { - // TODO: implement tests once spaces have the concept of disabled features - it('should be tested', () => null); -});