digitransit-ui/test/unit/component/LangSelect.test.js
2025-06-17 14:51:43 +03:00

27 lines
800 B
JavaScript

import { expect } from 'chai';
import { describe, it } from 'mocha';
import React from 'react';
import { Settings } from 'luxon';
import { mockContext } from '../helpers/mock-context';
import { shallowWithIntl } from '../helpers/mock-intl-enzyme';
import { Component as LangSelect } from '../../../app/component/LangSelect';
describe('LangSelect', () => {
after(() => {
Settings.defaultLocale = 'en';
});
describe('<LangSelect />', () => {
it('should render', () => {
const wrapper = shallowWithIntl(<LangSelect currentLanguage="en" />, {
context: {
...mockContext,
executeAction: () => true,
config: { availableLanguages: ['fi', 'sv', 'en'] },
},
});
expect(wrapper.isEmptyRender()).to.equal(false);
});
});
});