Skip to content

Commit

Permalink
test for action.js
Browse files Browse the repository at this point in the history
  • Loading branch information
himanshu-wedensday committed Apr 9, 2024
1 parent aafd61d commit 1340a13
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions app/components/atoms/LanguageProvider/tests/action.test.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
import { changeLocale } from '../actions';
import { CHANGE_LOCALE } from '../constants'; // Import your action creator and action type
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', () => {
// Define the expected language locale
const languageLocale = 'fr';
// Expected action object to be returned
const languageLocale = 'en';
const expectedAction = {
type: CHANGE_LOCALE,
locale: languageLocale
};
// Call the changeLocale action creator with a languageLocale argument
const action = changeLocale(languageLocale);
// Assert that the action creator returns the correct action
expect(action).toEqual(expectedAction);
});
});

0 comments on commit 1340a13

Please sign in to comment.