Skip to content

Commit

Permalink
fix: Notifications Page Linting (#2441)
Browse files Browse the repository at this point in the history
* fixed linting

* test: Code Coverage: Notifications Page #1  (#2448)

* setup

* coverage at 32

* resovled comments

* test: Code Coverage: Notifications Page #2 (#2470)

* coverage at 88

* coverage at 97

---------

Co-authored-by: Jay Budhadev <[email protected]>

---------

Co-authored-by: Jay Budhadev <[email protected]>

---------

Co-authored-by: Jay Budhadev <[email protected]>
  • Loading branch information
jayfyle and Jay Budhadev authored Oct 3, 2023
1 parent cf47309 commit a19fe01
Show file tree
Hide file tree
Showing 5 changed files with 490 additions and 94 deletions.
10 changes: 9 additions & 1 deletion src/app/core/mock-data/org-settings.data.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AllowedPaymentModes } from '../models/allowed-payment-modes.enum';
import { OrgSettings, TaxSettings } from '../models/org-settings.model';
import { EmailEvents, OrgSettings, TaxSettings } from '../models/org-settings.model';
import { orgSettingsData } from '../test-data/accounts.service.spec.data';

export const orgSettingsRes: OrgSettings = {
Expand Down Expand Up @@ -1346,3 +1346,11 @@ export const orgSettingsWoMileage: OrgSettings = {
...orgSettingsParams2,
mileage: null,
};

export const orgSettingsWithUnsubscribeEvent: OrgSettings = {
...orgSettingsRes,
admin_email_settings: {
...orgSettingsRes.admin_email_settings,
unsubscribed_events: [EmailEvents.DELEGATOR_SUBSCRIPTION, EmailEvents.EADVANCES_CREATED],
},
};
27 changes: 27 additions & 0 deletions src/app/core/mock-data/org-user-settings.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -683,3 +683,30 @@ export const orgUserSettingsWoProjects: OrgUserSettings = {
...orgUserSettingsData,
project_ids: null,
};

export const notificationDelegateeSettings1: OrgUserSettings = {
...orgUserSettingsData,
notification_settings: {
...orgUserSettingsData.notification_settings,
notify_delegatee: true,
notify_user: false,
},
};

export const notificationDelegateeSettings2: OrgUserSettings = {
...orgUserSettingsData,
notification_settings: {
...orgUserSettingsData.notification_settings,
notify_delegatee: false,
notify_user: true,
},
};

export const notificationDelegateeSettings3: OrgUserSettings = {
...orgUserSettingsData,
notification_settings: {
...orgUserSettingsData.notification_settings,
notify_delegatee: true,
notify_user: true,
},
};
17 changes: 15 additions & 2 deletions src/app/core/models/notification-events.model.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { EmailEvents as EE } from './org-settings.model';

export type EmailEvents = {
email: {
selected: boolean;
};
eventType: string;
eventType: string | EE;
feature: string;
push: {
selected: boolean;
Expand All @@ -14,7 +16,7 @@ export type EmailEvents = {
export interface NotificationEvents {
events: EmailEvents[];
features: {
advances: {
advances?: {
selected: boolean;
textLabel: string;
};
Expand All @@ -24,3 +26,14 @@ export interface NotificationEvents {
};
};
}

export interface NotificationEventFeatures {
advances: {
selected: boolean;
textLabel: string;
};
expensesAndReports: {
selected: boolean;
textLabel: string;
};
}
Loading

0 comments on commit a19fe01

Please sign in to comment.