Skip to content

Commit

Permalink
feat: added deepFreeze to not pollute global mock data - Part 3 (#2915)
Browse files Browse the repository at this point in the history
* feat: added deepFreeze to not pollute global mock data - Part 3

* feat: added deepFreeze to not pollute global mock data - Part 4 (#2916)

* feat: added deepFreeze to not pollute global mock data - Part 4

* feat: added deepFreeze to not pollute global mock data - Part 5 (#2917)

* feat: added deepFreeze to not pollute global mock data - Part 5

* feat: added deepFreeze to not pollute global mock data - Part 6 (#2918)

* feat: added deepFreeze to not pollute global mock data - Part 6

* feat: added deepFreeze to not pollute global mock data - Part 7 (#2919)

* feat: added deepFreeze to not pollute global mock data - Part 7

* minor

* feat: added deepFreeze to not pollute global mock data - Part 8 (#2922)

* feat: added deepFreeze to not pollute global mock data - Part 8

* feat: added deepFreeze to not pollute global mock data - Part 9 (#2924)

* feat: added deepFreeze to not pollute global mock data - Part 9

* feat: added deepFreeze to not pollute global mock data - Part 10 (#2925)

* feat: added deepFreeze to not pollute global mock data - Part 10

* feat: added deepFreeze to not pollute global mock data - Part 11 (#2927)

* feat: added deepFreeze to not pollute global mock data - Part 11

* feat: added deepFreeze to not pollute global mock data - Part 12 (#2929)

* feat: added deepFreeze to not pollute global mock data - Part 12

* feat: added deepFreeze to not pollute global mock data - Part 13 (#2930)

* feat: added deepFreeze to not pollute global mock data - Part 13

* minor

* feat: added deepFreeze to not pollute global mock data - Part 14 (#2933)

* feat: added deepFreeze to not pollute global mock data - Part 14

* feat: added deepFreeze to not pollute global mock data - Part 15 (#2934)

* feat: added deepFreeze to not pollute global mock data - Part 15

* test: fixing tests - part 1 (#2939)

* test: fixing tests - part 1

* test: fixing tests - part 2 (#2940)

* test: fixing tests - part 2

* test: fixing tests - part 3 (#2941)

* test: fixing tests - part 3

* test: fixing tests - part 4 (#2943)

* test: fixing tests - part 4

* test: fixing tests - part 5 (#2945)

* minor
  • Loading branch information
suyashpatil78 authored May 4, 2024
1 parent 2413424 commit 1b0e8a5
Show file tree
Hide file tree
Showing 211 changed files with 3,272 additions and 2,792 deletions.
6 changes: 4 additions & 2 deletions src/app/core/mock-data/dashboard-task.data.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import deepFreeze from 'deep-freeze-strict';

import { DashboardTask } from '../models/dashboard-task.model';
import { TaskIcon } from '../models/task-icon.enum';

export const dashboardTasksData: DashboardTask[] = [
export const dashboardTasksData: DashboardTask[] = deepFreeze([
{
icon: TaskIcon.WARNING,
header: '77 Potential Duplicates',
Expand Down Expand Up @@ -34,4 +36,4 @@ export const dashboardTasksData: DashboardTask[] = [
count: 11,
ctas: [{ content: 'Show Reports', event: 5 }],
},
];
]);
18 changes: 10 additions & 8 deletions src/app/core/mock-data/data-transform.data.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import deepFreeze from 'deep-freeze-strict';

import { FlattenedAccount } from '../models/flattened-account.model';

export const dataErtpTransformed = {
export const dataErtpTransformed = deepFreeze({
'': {
search_document:
"'46040':4 'a':8,14,20,26 'abhishek':32 '[email protected]':34 'business':11,17,23,29 'c/2022/10/r/37':5 'director':6 'indeed':13,19,25,31 'inr':3 'jain':33 'long':10,16,22,28 'mumbai':7 'report':2 'testing':1 'unit':12,18,24,30 'very':9,15,21,27",
Expand Down Expand Up @@ -64,9 +66,9 @@ export const dataErtpTransformed = {
email: '[email protected]',
full_name: 'Abhishek Jain',
},
};
});

export const apiErptReporDataParam = {
export const apiErptReporDataParam = deepFreeze({
'': {
search_document:
"'46040':4 'a':8,14,20,26 'abhishek':32 '[email protected]':34 'business':11,17,23,29 'c/2022/10/r/37':5 'director':6 'indeed':13,19,25,31 'inr':3 'jain':33 'long':10,16,22,28 'mumbai':7 'report':2 'testing':1 'unit':12,18,24,30 'very':9,15,21,27",
Expand Down Expand Up @@ -130,9 +132,9 @@ export const apiErptReporDataParam = {
email: '[email protected]',
full_name: 'Abhishek Jain',
},
};
});

export const flattenedData: FlattenedAccount = {
export const flattenedData: FlattenedAccount = deepFreeze({
acc_id: 'acct0vTdfNQrT',
acc_created_at: '2019-09-19T10:19:37.764Z',
acc_updated_at: '2023-03-10T11:29:40.049Z',
Expand All @@ -156,9 +158,9 @@ export const flattenedData: FlattenedAccount = {
orig_amount: 2500,
amount: 2500,
advance_id: 'aDvId123',
};
});

export const unflattenedData = {
export const unflattenedData = deepFreeze({
acc: {
id: 'acct0vTdfNQrT',
created_at: '2019-09-19T10:19:37.764Z',
Expand Down Expand Up @@ -196,4 +198,4 @@ export const unflattenedData = {
},
currency: 'INR',
amount: 2500,
};
});
22 changes: 12 additions & 10 deletions src/app/core/mock-data/default-txn-field-values.data.ts
Original file line number Diff line number Diff line change
@@ -1,36 +1,38 @@
import deepFreeze from 'deep-freeze-strict';

import { DefaultTxnFieldValues } from '../models/v1/default-txn-field-values.model';

export const defaultTxnFieldValuesData: Partial<DefaultTxnFieldValues> = {
export const defaultTxnFieldValuesData: Partial<DefaultTxnFieldValues> = deepFreeze({
purpose: 'test_term',
tax_group_id: 'GST',
};
});

export const defaultTxnFieldValuesData2_1: Partial<DefaultTxnFieldValues> = {
export const defaultTxnFieldValuesData2_1: Partial<DefaultTxnFieldValues> = deepFreeze({
purpose: 'test_term',
tax_group_id: 'GST',
flight_journey_travel_class: {
options: ['BUSINESS'],
},
};
});

export const defaultTxnFieldValuesData3: Partial<DefaultTxnFieldValues> = {
export const defaultTxnFieldValuesData3: Partial<DefaultTxnFieldValues> = deepFreeze({
purpose: 'test_term',
tax_group_id: 'GST',
vendor_id: 'vendor',
billable: true,
};
});

export const defaultTxnFieldValuesData2: Partial<DefaultTxnFieldValues> = {
export const defaultTxnFieldValuesData2: Partial<DefaultTxnFieldValues> = deepFreeze({
purpose: 'test_term',
cost_center_id: 15818,
from_dt: '2023-01-01',
to_dt: '2023-02-02',
num_days: 32,
billable: true,
};
});

export const defaultTxnFieldValuesData4: Partial<DefaultTxnFieldValues> = {
export const defaultTxnFieldValuesData4: Partial<DefaultTxnFieldValues> = deepFreeze({
purpose: 'test_term',
cost_center_id: 15818,
billable: true,
};
});
10 changes: 6 additions & 4 deletions src/app/core/mock-data/dependent-field-expenses.data.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import deepFreeze from 'deep-freeze-strict';

import { Expense } from '../models/expense.model';

export const expensesWithDependentFields: Expense[] = [
export const expensesWithDependentFields: Expense[] = deepFreeze([
{
corporate_credit_card_account_number: null,
credit: false,
Expand Down Expand Up @@ -445,9 +447,9 @@ export const expensesWithDependentFields: Expense[] = [
isCriticalPolicyViolated: false,
vendorDetails: '213',
},
];
]);

export const expensesWithSameProject: Expense[] = [
export const expensesWithSameProject: Expense[] = deepFreeze([
{
corporate_credit_card_account_number: null,
credit: false,
Expand Down Expand Up @@ -871,4 +873,4 @@ export const expensesWithSameProject: Expense[] = [
isCriticalPolicyViolated: false,
vendorDetails: '213',
},
];
]);
18 changes: 10 additions & 8 deletions src/app/core/mock-data/dependent-field-mapping.data.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import deepFreeze from 'deep-freeze-strict';

import { CustomProperty } from '../models/custom-properties.model';

interface dependentFieldMapping {
[fieldId: number]: CustomProperty<string>[];
}

export const dependentFieldsMappingForProject: dependentFieldMapping = {
export const dependentFieldsMappingForProject: dependentFieldMapping = deepFreeze({
316908: [
{
name: 'CF1',
Expand Down Expand Up @@ -33,9 +35,9 @@ export const dependentFieldsMappingForProject: dependentFieldMapping = {
value: null,
},
],
};
});

export const dependentFieldsMappingForSameProject: dependentFieldMapping = {
export const dependentFieldsMappingForSameProject: dependentFieldMapping = deepFreeze({
316992: [
{
name: 'CF1',
Expand All @@ -50,13 +52,13 @@ export const dependentFieldsMappingForSameProject: dependentFieldMapping = {
value: 'CF3.3',
},
],
};
});

export const dependentFieldsMappingForNoDependentFields: dependentFieldMapping = {
export const dependentFieldsMappingForNoDependentFields: dependentFieldMapping = deepFreeze({
316992: [],
};
});

export const dependentFieldsMappingForCostCenter: dependentFieldMapping = {
export const dependentFieldsMappingForCostCenter: dependentFieldMapping = deepFreeze({
16743: [
{
name: 'Dependent Field Of Cost Center',
Expand All @@ -69,4 +71,4 @@ export const dependentFieldsMappingForCostCenter: dependentFieldMapping = {
value: 'Dep. Value 3',
},
],
};
});
18 changes: 10 additions & 8 deletions src/app/core/mock-data/dependent-field-option.data.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import deepFreeze from 'deep-freeze-strict';

import { DependentFieldOption } from '../models/dependent-field-option.model';

export const dependentFieldOptions: DependentFieldOption[] = [
export const dependentFieldOptions: DependentFieldOption[] = deepFreeze([
{
label: 'Other Dep. Value 1',
value: 'Other Dep. Value 1',
Expand All @@ -16,9 +18,9 @@ export const dependentFieldOptions: DependentFieldOption[] = [
value: 'Other Dep. Value 3',
selected: false,
},
];
]);

export const dependentFieldOptionsWithoutSelection: DependentFieldOption[] = [
export const dependentFieldOptionsWithoutSelection: DependentFieldOption[] = deepFreeze([
{
label: 'None',
value: null,
Expand All @@ -39,9 +41,9 @@ export const dependentFieldOptionsWithoutSelection: DependentFieldOption[] = [
value: 'Other Dep. Value 3',
selected: false,
},
];
]);

export const dependentFieldOptionsWithSelection: DependentFieldOption[] = [
export const dependentFieldOptionsWithSelection: DependentFieldOption[] = deepFreeze([
{
label: 'None',
value: null,
Expand All @@ -62,9 +64,9 @@ export const dependentFieldOptionsWithSelection: DependentFieldOption[] = [
value: 'Other Dep. Value 3',
selected: false,
},
];
]);

export const dependentFieldOptionsWithSelectionNotInList: DependentFieldOption[] = [
export const dependentFieldOptionsWithSelectionNotInList: DependentFieldOption[] = deepFreeze([
{
label: 'None',
value: null,
Expand All @@ -90,4 +92,4 @@ export const dependentFieldOptionsWithSelectionNotInList: DependentFieldOption[]
value: 'Other Dep. Value 3',
selected: false,
},
];
]);
10 changes: 6 additions & 4 deletions src/app/core/mock-data/dependent-field-value.data.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import deepFreeze from 'deep-freeze-strict';

import { PlatformDependentFieldValue } from '../models/platform/platform-dependent-field-value.model';

export const dependentFieldValues: PlatformDependentFieldValue[] = [
export const dependentFieldValues: PlatformDependentFieldValue[] = deepFreeze([
{
created_at: '2023-03-23T07:29:25.836584+00:00',
expense_field_id: 221309,
Expand Down Expand Up @@ -34,9 +36,9 @@ export const dependentFieldValues: PlatformDependentFieldValue[] = [
parent_expense_field_value: 'Project 1',
updated_at: '2023-03-23T07:29:36.441882+00:00',
},
];
]);

export const dependentFieldOptionsForCostCode: PlatformDependentFieldValue[] = [
export const dependentFieldOptionsForCostCode: PlatformDependentFieldValue[] = deepFreeze([
{
created_at: '2023-02-23T10:50:38.058403+00:00',
expense_field_id: 219199,
Expand All @@ -59,4 +61,4 @@ export const dependentFieldOptionsForCostCode: PlatformDependentFieldValue[] = [
parent_expense_field_value: 'Project 1',
updated_at: '2023-02-23T10:51:06.155705+00:00',
},
];
]);
10 changes: 6 additions & 4 deletions src/app/core/mock-data/dependent-field.data.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import deepFreeze from 'deep-freeze-strict';

import { TxnCustomProperties } from '../models/txn-custom-properties.model';

export const projectDependentFields: TxnCustomProperties[] = [
export const projectDependentFields: TxnCustomProperties[] = deepFreeze([
{
id: 218227,
prefix: '',
Expand Down Expand Up @@ -56,9 +58,9 @@ export const projectDependentFields: TxnCustomProperties[] = [
options: ['CF5.1', 'CF5.2', 'CF5.3', 'CF5.4', 'CF5.5'],
parent_field_id: 218230,
},
];
]);

export const costCenterDependentFields: TxnCustomProperties[] = [
export const costCenterDependentFields: TxnCustomProperties[] = deepFreeze([
{
id: 221308,
prefix: '',
Expand All @@ -70,4 +72,4 @@ export const costCenterDependentFields: TxnCustomProperties[] = [
options: [],
parent_field_id: 221283,
},
];
]);
8 changes: 5 additions & 3 deletions src/app/core/mock-data/directions-results.data.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
export const directionsResponse1: string =
import deepFreeze from 'deep-freeze-strict';

export const directionsResponse1 =
'oygtBwpx}La@LMHGPB`@AXNl@BXC\\Wd@k@Y[QEIKg@WwCKYt@Wr@Qb@Ip@]v@_@h@SIWOe@XONK@GE_@Uq@MOM@';

export const directionsResponse2 = {
export const directionsResponse2 = deepFreeze({
message: 'No route found',
};
});
26 changes: 14 additions & 12 deletions src/app/core/mock-data/duplicate-sets.data.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
import deepFreeze from 'deep-freeze-strict';

import { DuplicateSet } from '../models/v2/duplicate-sets.model';

export const duplicateSetData1: DuplicateSet = {
export const duplicateSetData1: DuplicateSet = deepFreeze({
fields: ['field1', 'field2'],
transaction_ids: ['tx5fBcPBAxLv'],
};
});

export const duplicateSetData2: DuplicateSet = {
export const duplicateSetData2: DuplicateSet = deepFreeze({
fields: ['field1', 'field2'],
transaction_ids: ['tx5fBcPBAxLv', 'tx3nHShG60zq'],
};
});

export const duplicateSetData3: DuplicateSet = {
export const duplicateSetData3: DuplicateSet = deepFreeze({
fields: ['field1', 'field2'],
transaction_ids: ['txcSFe6efB6R', 'txDDLtRaflUW'],
};
});

export const duplicateSetData4: DuplicateSet = {
export const duplicateSetData4: DuplicateSet = deepFreeze({
transaction_ids: ['tx5fBcPBAxLv'],
};
});

export const duplicateSetData5: DuplicateSet = {
export const duplicateSetData5: DuplicateSet = deepFreeze({
fields: ['field1', 'field2'],
transaction_ids: ['txal5xGjbZ1R'],
};
});

export const duplicateSetData6: DuplicateSet = {
export const duplicateSetData6: DuplicateSet = deepFreeze({
transaction_ids: ['txal5xGjbZ1R'],
};
});
6 changes: 4 additions & 2 deletions src/app/core/mock-data/email-events.data.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import deepFreeze from 'deep-freeze-strict';

import { EmailEventsObject } from '../models/email-events.model';

export const emailEvents: EmailEventsObject = {
export const emailEvents: EmailEventsObject = deepFreeze({
features: {
expensesAndReports: {
textLabel: 'Expenses and Reports',
Expand Down Expand Up @@ -165,4 +167,4 @@ export const emailEvents: EmailEventsObject = {
},
},
},
};
});
Loading

0 comments on commit 1b0e8a5

Please sign in to comment.