Skip to content

Testing Mixins in controllers #12

Description

@RobertMrowiec

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);
  });

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions