Skip to content

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

@gossi

Description

@gossi

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions