Skip to content

Commit

Permalink
chore(orga): remove component unit tests for Auth::LoginOrRegister
Browse files Browse the repository at this point in the history
  • Loading branch information
frinyvonnick committed Sep 24, 2024
1 parent 146d15b commit fc7c0a2
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 37 deletions.
26 changes: 26 additions & 0 deletions orga/tests/integration/components/auth/login-or-register-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,32 @@ module('Integration | Component | Auth::LoginOrRegister', function (hooks) {
await click(screen.getByRole('option', { name: 'English' }));
assert.dom(screen.getByText('You have been invited to join the organisation Organization Aztec')).exists();
});

test('saves selected locale and remove lang from query params', async function (assert) {
// given
class CurrentDomainServiceStub extends Service {
get isFranceDomain() {
return false;
}
}

this.owner.register('service:currentDomain', CurrentDomainServiceStub);
const routerService = this.owner.lookup('service:router');
const localeService = this.owner.lookup('service:locale');

sinon.stub(routerService, 'replaceWith');
sinon.stub(localeService, 'setLocale');

// when
const screen = await render(hbs`<Auth::LoginOrRegister @organizationName='Organization Aztec' />`);
await click(screen.getByRole('button', { name: t('pages.login.choose-language-aria-label') }));
await screen.findByRole('listbox');
await click(screen.getByRole('option', { name: 'English' }));

// then
assert.ok(localeService.setLocale.calledWithMatch('en'));
assert.ok(routerService.replaceWith.calledWithMatch('join', { queryParams: { lang: null } }));
});
});

module('when domain is .fr', function () {
Expand Down
37 changes: 0 additions & 37 deletions orga/tests/unit/components/auth/login-or-register-test.js

This file was deleted.

0 comments on commit fc7c0a2

Please sign in to comment.