Skip to content

Commit

Permalink
added test for properly translated month name to weekly events
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelchadwick committed Jul 25, 2024
1 parent c0b1ace commit 6fa4a6e
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ import { setupRenderingTest } from 'test-app/tests/helpers';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
import { component } from 'ilios-common/page-objects/components/weekly-events';
import { setLocale, setupIntl } from 'ember-intl/test-support';

module('Integration | Component | weekly events', function (hooks) {
setupRenderingTest(hooks);
setupIntl(hooks, 'en-us');

test('it renders', async function (assert) {
this.intl = this.owner.lookup('service:intl');
this.set('year', 2017);
await render(hbs`<WeeklyEvents
@year={{this.year}}
Expand All @@ -23,6 +26,14 @@ module('Integration | Component | weekly events', function (hooks) {
assert.strictEqual(component.bottomNavigation.previousYear.title, 'Go to previous year');
assert.strictEqual(component.bottomNavigation.nextYear.title, 'Go to next year');
assert.strictEqual(component.weeks.length, 52);

assert.strictEqual(component.weeks[0].title, 'January 1-7');

await setLocale('es');
assert.strictEqual(component.weeks[0].title, 'enero 2-8');

await setLocale('fr');
assert.strictEqual(component.weeks[0].title, 'janvier 2-8');
});

test('top navigation - go to next year', async function (assert) {
Expand Down

0 comments on commit 6fa4a6e

Please sign in to comment.