From 52035a546e20ec6b2c4fc1b949208195d782a927 Mon Sep 17 00:00:00 2001 From: HIMANSHU Date: Fri, 12 Apr 2024 02:07:57 +0530 Subject: [PATCH] Added test for actions --- .../atoms/LanguageProvider/tests/action.test.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 app/components/atoms/LanguageProvider/tests/action.test.js diff --git a/app/components/atoms/LanguageProvider/tests/action.test.js b/app/components/atoms/LanguageProvider/tests/action.test.js new file mode 100644 index 0000000..a0bd652 --- /dev/null +++ b/app/components/atoms/LanguageProvider/tests/action.test.js @@ -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); + }); +});