Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrated src/components/ChangeLanguageDropdown from Jest to Vitest #2909

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { MockedProvider } from '@apollo/react-testing';
import { UPDATE_USER_MUTATION } from 'GraphQl/Mutations/mutations';
import { StaticMockLink } from 'utils/StaticMockLink';
import useLocalStorage from 'utils/useLocalstorage';
import { describe, expect, it } from 'vitest';
// import { Provider } from 'react-redux';
// import { store } from 'state/store';
const { setItem } = useLocalStorage();
Expand Down Expand Up @@ -52,7 +53,7 @@ const MOCKS = [

const link = new StaticMockLink(MOCKS, true);
describe('Testing Change Language Dropdown', () => {
test('Component Should be rendered properly', async () => {
it('Component Should be rendered properly', async () => {
const { getByTestId } = render(
<MockedProvider addTypename={false} link={link}>
<BrowserRouter>
Expand Down Expand Up @@ -81,7 +82,7 @@ describe('Testing Change Language Dropdown', () => {
});
});

test('Component Should accept props properly', async () => {
it('Component Should accept props properly', async () => {
const props = {
parentContainerStyle: 'parentContainerStyle',
btnStyle: 'btnStyle',
Expand All @@ -103,7 +104,7 @@ describe('Testing Change Language Dropdown', () => {
getByTestId('dropdown-btn-0').className.includes(props.btnTextStyle);
});

test('Testing when language cookie is not set', async () => {
it('Testing when language cookie is not set', async () => {
Object.defineProperty(window.document, 'cookie', {
writable: true,
value: 'i18next=',
Expand All @@ -121,7 +122,7 @@ describe('Testing Change Language Dropdown', () => {
expect(cookies.get('i18next')).toBe('');
});

test('Testing change language functionality', async () => {
it('Testing change language functionality', async () => {
Object.defineProperty(window.document, 'cookie', {
writable: true,
value: 'i18next=sp',
Expand Down
Loading