-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6dba9cf
commit aafd61d
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
app/components/atoms/LanguageProvider/tests/action.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { changeLocale } from '../actions'; | ||
import { CHANGE_LOCALE } from '../constants'; // Import your action creator and action type | ||
|
||
// 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 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); | ||
}); | ||
}); |