Skip to content
This repository has been archived by the owner on Apr 18, 2023. It is now read-only.

Refactor test helpers #468

Closed
cibernox opened this issue Dec 19, 2017 · 0 comments · Fixed by #470
Closed

Refactor test helpers #468

cibernox opened this issue Dec 19, 2017 · 0 comments · Fixed by #470

Comments

@cibernox
Copy link
Collaborator

cibernox commented Dec 19, 2017

There is several ways in which the test helpers should be improved:

  1. The idiomatic place to put test helpers is inside /addon-test-support. We should move them. To ease the transition, we should import and reexport with a deprecation from /test-support for a while.
  2. Afaik Ember.Test.registerHelper is not required (I think it doesn't even work!) with the new test syntax proposed in Rethink Acceptance Testing emberjs/rfcs#268 and shipped already in ember-qunit 4.2.0. Helpers. Those helpers should be explicitly importable with import { expectTranslation } from 'ember-i18n/test-support/helpers';. That means they would also work in integration tests too.
  3. Make the helpers not rely on jQuery, as some apps don't use it anymore, and the goal is to not include it by default in future versions of Ember.
  4. IMHO, I believe a custom assertion like assert.hasTranslation('#selector', 'login.button.submit', { count: 4 }, 'Optional assertion description') would be more idiomatic. Although personally I would use a mix of qunit-dom and the t test helper: assert.dom('#selector').hasText(t('login.button.submit', { count: 4 }), 'Optional assertion description')

This radar is so I don't forger, but I'll try to work on those points myself over Xmas. But if someone wants to beat me to it, just leave a comment here and do it.

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

Successfully merging a pull request may close this issue.

1 participant