Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a different approach for isRouterInitialized #555

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
- ember-3.24
- ember-release
- ember-beta
# - ember-canary
# - ember-canary
steps:
- name: Checkout Code
uses: actions/checkout@v1
Expand Down
3 changes: 2 additions & 1 deletion addon/services/link-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ export default class LinkManagerService extends Service {
//
// Inspiration for this workaround was taken from the `currentURL()` test
// helper (see https://github.com/emberjs/ember-test-helpers/blob/v2.1.4/addon-test-support/@ember/test-helpers/setup-application-context.ts#L180)
return Boolean(getOwner(this).lookup('router:main').currentURL);
const router = getOwner(this).lookup('router:main');
return Boolean(router.location) && router.location !== 'none';
}

/**
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"ember-on-modifier": "^1.0.1",
"ember-qunit": "^4.6.0",
"ember-resolver": "^8.0.2",
"ember-source": "~3.25.0",
"ember-source": "~3.25.3",
"ember-source-channel-url": "^3.0.0",
"ember-template-lint": "^2.18.1",
"ember-try": "^1.4.0",
Expand Down
17 changes: 1 addition & 16 deletions tests/integration/components/link-to-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,10 @@ module('Component | LinkTo', function (hooks) {
</LinkTo>
`);

assert.dom('[data-test-link]').hasNoAttribute('href');
assert.dom('[data-test-link]').hasAttribute('href', `/foo`);
assert.dom('[data-test-link]').hasNoClass('is-active');
});

test('triggering a transition has no effect', async function (assert) {
await render(hbs`
<LinkTo @route="foo" data-test-link>
Link
</LinkTo>
`);
assert.strictEqual(currentURL(), null);

const error = await waitForError(() => click('[data-test-link]'));
assert.ok(error instanceof Error);
// Ember 3.23 and below are throwing "Cannot read property 'hasRoute' of
// undefined" here, but we don't care what the exact error is.
assert.strictEqual(currentURL(), null);
});

module('with incomplete models', function () {
test('it renders', async function (assert) {
await render(hbs`
Expand Down
18 changes: 9 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1532,10 +1532,10 @@
resolved "https://registry.yarnpkg.com/@glimmer/validator/-/validator-0.44.0.tgz#03d127097dc9cb23052cdb7fcae59d0a9dca53e1"
integrity sha512-i01plR0EgFVz69GDrEuFgq1NheIjZcyTy3c7q+w7d096ddPVeVcRzU3LKaqCfovvLJ+6lJx40j45ecycASUUyw==

"@glimmer/vm-babel-plugins@0.74.2":
version "0.74.2"
resolved "https://registry.yarnpkg.com/@glimmer/vm-babel-plugins/-/vm-babel-plugins-0.74.2.tgz#479774d5885201538245f4cba76cabd4b0dee3a5"
integrity sha512-DLIKzim7Fg3o54EPgz/wsEiLOUcg24P4WJ9AAv4xsXfBmFndkEDzq1oJ3SPhB167Vp1m+GKOlfKzFm9mxX5rdA==
"@glimmer/vm-babel-plugins@0.77.1":
version "0.77.1"
resolved "https://registry.yarnpkg.com/@glimmer/vm-babel-plugins/-/vm-babel-plugins-0.77.1.tgz#80c8b5476ccff68191bc42ebb29928a9b8d22d69"
integrity sha512-amkBPV3H/3OhYIeXo03sU1VzqmUl8TUxHhjfVJwRy+vQV22S5saZCiUCyOYUsUkxdEG5sU8qooooBY8VomkkBg==
dependencies:
babel-plugin-debug-macros "^0.3.4"

Expand Down Expand Up @@ -6217,16 +6217,16 @@ ember-source-channel-url@^3.0.0:
dependencies:
node-fetch "^2.6.0"

ember-source@~3.25.0:
version "3.25.0"
resolved "https://registry.yarnpkg.com/ember-source/-/ember-source-3.25.0.tgz#feef65857630964e4d63ba813a2d6c4af2e387ca"
integrity sha512-EMxsGIdbwtrTtOwFY0tDMI/R6LUtYJCDpOpMIW7PUKDTMxy3aVL9EjL92wG9qxFirj8W3teXvs6yNTSc2ebSoA==
ember-source@~3.25.3:
version "3.25.3"
resolved "https://registry.yarnpkg.com/ember-source/-/ember-source-3.25.3.tgz#a64278a2dcc36b03056589e1b7393f4558c42d70"
integrity sha512-3HgfvYJfvcALNJSsPvbN0qn9ykI7Px7mPyCidXJRdm+tdPB0DKFW3nqT+4W+7YysWYGsj6yS81NhksnXEw4Naw==
dependencies:
"@babel/helper-module-imports" "^7.8.3"
"@babel/plugin-transform-block-scoping" "^7.8.3"
"@babel/plugin-transform-object-assign" "^7.8.3"
"@ember/edition-utils" "^1.2.0"
"@glimmer/vm-babel-plugins" "0.74.2"
"@glimmer/vm-babel-plugins" "0.77.1"
babel-plugin-debug-macros "^0.3.3"
babel-plugin-filter-imports "^4.0.0"
broccoli-concat "^4.2.4"
Expand Down