CEC-2389 Add unit tests for SMS Context and SMS form (#247)
This commit is contained in:
28
src/components/Contexts/__mocks__/SMSContext.jsx
Normal file
28
src/components/Contexts/__mocks__/SMSContext.jsx
Normal file
@@ -0,0 +1,28 @@
|
||||
import React from 'react';
|
||||
|
||||
const SMSContext = React.createContext();
|
||||
|
||||
let busy = false;
|
||||
const smsResult = {
|
||||
smsMsgID:438222039,
|
||||
status:"Pending",
|
||||
messageText:"Test message",
|
||||
senderLogin:"tfbenterpriseapiuser",
|
||||
sentTo:"18707906682",
|
||||
sentFrom: "Server",
|
||||
msgType: "MT",
|
||||
dateSent: "2021-08-17T15:00:00.000Z",
|
||||
dateModified: "2021-08-17T15:00:00.000Z",
|
||||
ICCID: "8988300000000000000",
|
||||
};
|
||||
|
||||
export const SMSProvider = ({ children }) => {
|
||||
return <div data-testid="mocked-smsprovider">{children}</div>;
|
||||
}
|
||||
|
||||
export const useSMSContext = () => {
|
||||
return {
|
||||
busy,
|
||||
sendSMS: jest.fn(() => smsResult),
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user