decide.nolog.cz/tests/acceptance/i18n-test.js
jelhan 94b4dc6f82 use localStorage instead of cookie to save locale setting
there is no need to tell the server which locale is prefered by client
2016-08-21 14:31:39 +02:00

26 lines
676 B
JavaScript

import { test } from 'qunit';
import moduleForAcceptance from 'croodle/tests/helpers/module-for-acceptance';
import pageIndex from 'croodle/tests/pages/index';
moduleForAcceptance('Acceptance | i18n', {
beforeEach() {
window.localStorage.setItem('locale', 'en');
}
});
test('locale is saved in localStorage', function(assert) {
visit('/');
andThen(() => {
assert.equal(find('.language-select').val(), 'en');
pageIndex.locale('de');
andThen(function() {
assert.equal(find('.language-select').val(), 'de');
assert.equal(
window.localStorage.getItem('locale'), 'de',
'persisted in localeStorage'
);
});
});
});