chore: Upgrade vue-i18n to 8.x (#1383)
Co-authored-by: Pranav Raj S <pranav@thoughtwoot.com>
This commit is contained in:
parent
7f2f984bea
commit
f9bd447912
15 changed files with 75 additions and 38 deletions
|
@ -1,14 +1,26 @@
|
|||
import endPoints from '../endPoints';
|
||||
|
||||
jest.mock('vue', () => ({ config: { lang: 'ar' } }));
|
||||
|
||||
describe('#sendMessage', () => {
|
||||
it('returns correct payload', () => {
|
||||
const spy = jest.spyOn(global, 'Date').mockImplementation(() => ({
|
||||
toString: () => 'mock date',
|
||||
}));
|
||||
const windowSpy = jest.spyOn(window, 'window', 'get');
|
||||
windowSpy.mockImplementation(() => ({
|
||||
WOOT_WIDGET: {
|
||||
$root: {
|
||||
$i18n: {
|
||||
locale: 'ar',
|
||||
},
|
||||
},
|
||||
},
|
||||
location: {
|
||||
search: '?param=1',
|
||||
},
|
||||
}));
|
||||
|
||||
expect(endPoints.sendMessage('hello')).toEqual({
|
||||
url: `/api/v1/widget/messages?locale=ar`,
|
||||
url: `/api/v1/widget/messages?param=1&locale=ar`,
|
||||
params: {
|
||||
message: {
|
||||
content: 'hello',
|
||||
|
@ -17,6 +29,7 @@ describe('#sendMessage', () => {
|
|||
},
|
||||
},
|
||||
});
|
||||
windowSpy.mockRestore();
|
||||
spy.mockRestore();
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue