Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
describe('onBillChange', () => {
const testHelper = test();
// Mock change snapshots
const beforeSnap = testHelper.firestore.makeDocumentSnapshot(mockedBill, 'bills/ID');
const snap = testHelper.firestore.makeDocumentSnapshot(mockedUpdatedBill, 'bills/ID');
// Mock needed data
const mockedUserAndPendencies = {
user: mockedUpdatedUser,
pendencies: {
id: 'UID',
data: {
[pendencyKey]: mockedPendency,
},
},
describe('sendPendenciesAlerts', () => {
const testHelper = test();
testHelper.mockConfig({cron: {key: 'cronKey'}});
// // Mock needed data
const mockedUserWithI18n = {
...mockedUser2,
i18n: 'pt-BR',
};
const mockedUser3 = {
uid: 'UID3',
};
const mockedUserPendency = {
id: mockedUser.uid,
data: {
describe('updateAllPendencies', () => {
const testHelper = test();
testHelper.mockConfig({cron: {key: 'cronKey'}});
// // Mock needed data
const mockedUserWOToken = {
...mockedUser2,
fcmToken: null as string,
};
const mockedUserPendency = {
id: mockedUser.uid,
data: {
[pendencyKey]: mockedPendency,
},
};
describe('onPaydayChange', () => {
const testHelper = test();
// Mock change snapshots
const beforeSnap = testHelper.firestore.makeDocumentSnapshot(mockedUser, 'users/UID');
const snap = testHelper.firestore.makeDocumentSnapshot(mockedUpdatedUser, 'users/UID');
// Mock needed data
const mockedResultData = {
[pendencyKey]: mockedPendency,
[pendencyKey2]: mockedPendency2,
};
const mockedResult = {
id: 'UID',
data: mockedResultData,