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

Testing Mixins in controllers #12

Open
RobertMrowiec opened this issue Jun 6, 2019 · 0 comments
Open

Testing Mixins in controllers #12

RobertMrowiec opened this issue Jun 6, 2019 · 0 comments
Labels
enhancement New feature or request

Comments

@RobertMrowiec
Copy link

Could we provide description of how to test mixins in controllers? Mixins are often used in big apps so I think It's important to test it. For example:

  test('it changes page to first after choosing query', function(assert) {
    const searchController = Controller.extend(Paginated, {
      previousQuery: ''
    }).create();

    const mockParachuteObject = {
      changes: {
        q: 'test',
        page: 10
      }
    };

    searchController.setFirstPage(mockParachuteObject);

    assert.equal(searchController.page, 1);
  });
@PoslinskiNet PoslinskiNet added the enhancement New feature or request label Jun 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants