ember-command icon indicating copy to clipboard operation
ember-command copied to clipboard

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

Open gossi opened this issue 3 years ago • 0 comments

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.

gossi avatar Apr 28 '22 15:04 gossi