-
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
aafd61d
commit 1340a13
Showing
1 changed file
with
2 additions
and
6 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -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); | ||
}); | ||
}); |