Skip to content

Commit

Permalink
created user-guide-link page object and updated integration test to u…
Browse files Browse the repository at this point in the history
…se it
  • Loading branch information
michaelchadwick committed Jul 25, 2024
1 parent cc7ee08 commit 23c9ac3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { setupRenderingTest } from 'frontend/tests/helpers';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
import { setLocale, setupIntl } from 'ember-intl/test-support';
import { component } from 'frontend/tests/pages/components/user-guide-link';

module('Integration | Component | user-guide-link', function (hooks) {
setupRenderingTest(hooks);
Expand All @@ -11,16 +12,14 @@ module('Integration | Component | user-guide-link', function (hooks) {
test('it renders', async function (assert) {
await render(hbs`<UserGuideLink />`);

assert.dom('[data-test-user-guide-link]').exists();
assert.dom('[data-test-user-guide-link-icon]').exists();
assert.dom('[data-test-user-guide-link-icon]').hasText('Ilios User Guide');
assert.ok(component);
assert.ok(component.icon);
assert.strictEqual(component.icon.title, 'Ilios User Guide');

await setLocale('es');

assert.dom('[data-test-user-guide-link-icon]').hasText('Ilios Guía de usuario');
assert.strictEqual(component.icon.title, 'Ilios Guía de usuario');

await setLocale('fr');

assert.dom('[data-test-user-guide-link-icon]').hasText("Ilios Guide d'utilisation");
assert.strictEqual(component.icon.title, "Ilios Guide d'utilisation");
});
});
12 changes: 12 additions & 0 deletions packages/frontend/tests/pages/components/user-guide-link.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { create, text } from 'ember-cli-page-object';

const definition = {
scope: '[data-test-user-guide-link]',
icon: {
scope: '[data-test-user-guide-link-icon]',
title: text('title'),
},
};

export default definition;
export const component = create(definition);

0 comments on commit 23c9ac3

Please sign in to comment.