diff --git a/tests/helpers/setup-no-deprecations.js b/tests/helpers/setup-no-deprecations.js index eb67d9beb..d79b4e272 100644 --- a/tests/helpers/setup-no-deprecations.js +++ b/tests/helpers/setup-no-deprecations.js @@ -4,12 +4,17 @@ import { registerDeprecationHandler } from '@ember/debug'; let isRegistered = false; let deprecations; +// Ignore deprecations that are not caused by our own code, and which we cannot fix easily. +const ignoredDeprecations = [/Versions of modifier manager capabilities prior to 3\.22 have been deprecated/]; + export default function setupNoDeprecations({ beforeEach, afterEach }) { beforeEach(function () { deprecations = []; if (!isRegistered) { registerDeprecationHandler((message, options, next) => { - deprecations.push(message); + if (!ignoredDeprecations.some((regex) => message.match(regex))) { + deprecations.push(message); + } next(message, options); }); isRegistered = true; diff --git a/tests/integration/components/bs-dropdown-test.js b/tests/integration/components/bs-dropdown-test.js index 28ec2a6db..427310da6 100644 --- a/tests/integration/components/bs-dropdown-test.js +++ b/tests/integration/components/bs-dropdown-test.js @@ -321,7 +321,7 @@ module('Integration | Component | bs-dropdown', function (hooks) { Dropdown - {{menu.link-to "Home" "index"}} + Home `); diff --git a/tests/integration/components/bs-dropdown/menu-test.js b/tests/integration/components/bs-dropdown/menu-test.js index a5c73e672..8bfbdd229 100644 --- a/tests/integration/components/bs-dropdown/menu-test.js +++ b/tests/integration/components/bs-dropdown/menu-test.js @@ -58,8 +58,8 @@ module('Integration | Component | bs-dropdown/menu', function (hooks) { hbs` - {{#ddm.link-to "index"}}Link{{/ddm.link-to}} - {{#ddm.linkTo "index"}}Link{{/ddm.linkTo}} + Link + Link ` diff --git a/tests/integration/components/bs-dropdown/menu/link-to-test.js b/tests/integration/components/bs-dropdown/menu/link-to-test.js index 2b2898df8..821d843e0 100644 --- a/tests/integration/components/bs-dropdown/menu/link-to-test.js +++ b/tests/integration/components/bs-dropdown/menu/link-to-test.js @@ -4,13 +4,9 @@ import { render } from '@ember/test-helpers'; import { testBS3, testBS4 } from '../../../../helpers/bootstrap'; import hbs from 'htmlbars-inline-precompile'; import setupNoDeprecations from '../../../../helpers/setup-no-deprecations'; -import hasEmberVersion from '@ember/test-helpers/has-ember-version'; - -const supportsAngleBracketsLinkTo = hasEmberVersion(3, 10); module('Integration | Component | bs-dropdown/menu/link-to', function (hooks) { setupRenderingTest(hooks); - setupNoDeprecations(hooks); hooks.beforeEach(function () { this.owner.setupRouter(); }); @@ -64,32 +60,30 @@ module('Integration | Component | bs-dropdown/menu/link-to', function (hooks) { }); }); - if (supportsAngleBracketsLinkTo) { - module(' properties', function () { - test('simple route link', async function (assert) { - await render(hbs`Link`); + module(' properties', function (hooks) { + setupNoDeprecations(hooks); + + test('simple route link', async function (assert) { + await render(hbs`Link`); - assert.dom('a').exists({ count: 1 }); - assert.dom('a').hasText('Link'); - assert.dom('a').hasAttribute('href', '/'); - }); + assert.dom('a').exists({ count: 1 }); + assert.dom('a').hasText('Link'); + assert.dom('a').hasAttribute('href', '/'); + }); - test('link with model', async function (assert) { - await render( - hbs`Link` - ); + test('link with model', async function (assert) { + await render( + hbs`Link` + ); - assert.dom('a').exists({ count: 1 }); - assert.dom('a').hasAttribute('href', '/acceptance/link/1?foo=bar'); - }); + assert.dom('a').exists({ count: 1 }); + assert.dom('a').hasAttribute('href', '/acceptance/link/1?foo=bar'); + }); - test('disabled link', async function (assert) { - await render( - hbs`Link` - ); + test('disabled link', async function (assert) { + await render(hbs`Link`); - assert.dom('a').hasClass('disabled'); - }); + assert.dom('a').hasClass('disabled'); }); - } + }); }); diff --git a/tests/integration/components/bs-nav-test.js b/tests/integration/components/bs-nav-test.js index 05726913f..e9a3e155f 100644 --- a/tests/integration/components/bs-nav-test.js +++ b/tests/integration/components/bs-nav-test.js @@ -52,10 +52,10 @@ module('Integration | Component | bs-nav', function (hooks) { await render(hbs` - {{#nav.link-to "application"}}Dummy{{/nav.link-to}} + Dummy - {{#nav.linkTo "application"}}Dummy{{/nav.linkTo}} + Dummy Dropdown @@ -76,10 +76,10 @@ module('Integration | Component | bs-nav', function (hooks) { await render(hbs` - {{#nav.link-to "application"}}Dummy{{/nav.link-to}} + Dummy - {{#nav.linkTo "application"}}Dummy{{/nav.linkTo}} + Dummy Dropdown diff --git a/tests/integration/components/bs-nav/link-to-test.js b/tests/integration/components/bs-nav/link-to-test.js index a24dc80ee..7f11cb8a3 100644 --- a/tests/integration/components/bs-nav/link-to-test.js +++ b/tests/integration/components/bs-nav/link-to-test.js @@ -4,13 +4,9 @@ import { render } from '@ember/test-helpers'; import hbs from 'htmlbars-inline-precompile'; import setupNoDeprecations from '../../../helpers/setup-no-deprecations'; import { testBS4 } from '../../../helpers/bootstrap'; -import hasEmberVersion from '@ember/test-helpers/has-ember-version'; - -const supportsAngleBracketsLinkTo = hasEmberVersion(3, 10); module('Integration | Component | bs-nav/link-to', function (hooks) { setupRenderingTest(hooks); - setupNoDeprecations(hooks); hooks.beforeEach(function () { this.owner.setupRouter(); }); @@ -44,36 +40,36 @@ module('Integration | Component | bs-nav/link-to', function (hooks) { }); }); - if (supportsAngleBracketsLinkTo) { - module(' properties', function () { - test('simple route link', async function (assert) { - await render(hbs`Link`); + module(' properties', function (hooks) { + setupNoDeprecations(hooks); - assert.dom('a').exists({ count: 1 }); - assert.dom('a').hasText('Link'); - assert.dom('a').hasAttribute('href', '/'); - }); + test('simple route link', async function (assert) { + await render(hbs`Link`); - test('link with model', async function (assert) { - await render( - hbs`Link` - ); + assert.dom('a').exists({ count: 1 }); + assert.dom('a').hasText('Link'); + assert.dom('a').hasAttribute('href', '/'); + }); - assert.dom('a').exists({ count: 1 }); - assert.dom('a').hasAttribute('href', '/acceptance/link/1?foo=bar'); - }); + test('link with model', async function (assert) { + await render( + hbs`Link` + ); - testBS4('link has nav-link class', async function (assert) { - await render(hbs`Link`); + assert.dom('a').exists({ count: 1 }); + assert.dom('a').hasAttribute('href', '/acceptance/link/1?foo=bar'); + }); + + testBS4('link has nav-link class', async function (assert) { + await render(hbs`Link`); - assert.dom('a').hasClass('nav-link'); - }); + assert.dom('a').hasClass('nav-link'); + }); - test('disabled link', async function (assert) { - await render(hbs`Link`); + test('disabled link', async function (assert) { + await render(hbs`Link`); - assert.dom('a').hasClass('disabled'); - }); + assert.dom('a').hasClass('disabled'); }); - } + }); });