Skip to content

Commit

Permalink
Fix ember-link
Browse files Browse the repository at this point in the history
  • Loading branch information
gossi committed Jan 24, 2024
1 parent ca4e2a3 commit 5d3b936
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
8 changes: 4 additions & 4 deletions ember-link/src/helpers/link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@ export default class LinkHelper extends Helper<LinkSignature> {
models: Array.isArray(named.models)
? named.models
: named.model
? [named.model]
: positional.length > 1
? (positional.slice(1, positionalQueryParameters ? -1 : undefined) as RouteModel[])
: undefined,
? [named.model]
: positional.length > 1
? (positional.slice(1, positionalQueryParameters ? -1 : undefined) as RouteModel[])
: undefined,
query: named.query ?? positionalQueryParameters,
onTransitionTo: named.onTransitionTo,
onReplaceWith: named.onReplaceWith,
Expand Down
10 changes: 7 additions & 3 deletions ember-link/src/test-support/setup-link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@ export default function setupLink(hooks: Hooks /* NestedHooks */) {
hooks.beforeEach(function (this: TestContext) {
assert(
'ember-link.setupLink: You have already called `setupLink` once',
// !this.owner.hasRegistration('service:link-manager') ||
!(this.owner.lookup('service:link-manager') instanceof TestInstrumentedLinkManagerService)
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
!this.owner.hasRegistration('service:link-manager') ||
!(this.owner.lookup('service:link-manager') instanceof TestInstrumentedLinkManagerService)
);

// this.owner.unregister('service:link-manager');
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
this.owner.unregister('service:link-manager');
this.owner.register('service:link-manager', TestInstrumentedLinkManagerService);
});
}

0 comments on commit 5d3b936

Please sign in to comment.