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

Putting a TestLink into a @command will cause the tests to not prevent the transition #20

Open
gossi opened this issue Apr 28, 2022 · 0 comments

Comments

@gossi
Copy link
Owner

gossi commented Apr 28, 2022

Simply:

<MyComponent @link={{link ...}}/>

inside the component:

export default class MyComponent extends Component {
  @command
  go = commandFor([
    this.args.link,
    this.somethingElse
  ]);
}

and then writing tests for this:

test('it can follow the link', function () {
  this.link = linkFor('somewhere');
  this.link.onTransitionTo = () => assert.step('link clicked');

  await render(hbs`<MyComponent @link={{this.link}}/>`);

  await click(...);

  assert.verifySteps(['link clicked']);
});

the click() will actually make the link to be transitioned and not prevented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant