Skip to content

Commit

Permalink
Added test for actions
Browse files Browse the repository at this point in the history
  • Loading branch information
himanshu-wedensday committed Apr 11, 2024
1 parent de4a313 commit 52035a5
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions app/components/atoms/LanguageProvider/tests/action.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { changeLocale } from '../actions';
import { CHANGE_LOCALE } from '../constants';

// Test suite for the changeLocale action creator
describe('changeLocale action creator', () => {
it('should create an action to change the locale', () => {
const languageLocale = 'en';
const expectedAction = {
type: CHANGE_LOCALE,
locale: languageLocale
};
const action = changeLocale(languageLocale);
expect(action).toEqual(expectedAction);
});
});

0 comments on commit 52035a5

Please sign in to comment.