Skip to content

Commit

Permalink
Minor
Browse files Browse the repository at this point in the history
  • Loading branch information
bistaastha committed Jan 6, 2025
1 parent 09b744a commit 42958d0
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/app/shared/components/sidemenu/sidemenu.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ describe('SidemenuComponent', () => {
},
};

const cardOpt = component.getCardOptions();
const cardOpt = component.getCardOptions(false);
fixture.detectChanges();
expect(cardOpt).toEqual([
{
Expand Down Expand Up @@ -248,7 +248,7 @@ describe('SidemenuComponent', () => {
const resData = primOpt.filter((option) => option.title !== 'Personal Cards');
const cardOptSpy = spyOn(component, 'getCardOptions').and.returnValue([]);
const teamOptSpy = spyOn(component, 'getTeamOptions').and.returnValue([]);
const result = component.getPrimarySidemenuOptions(true);
const result = component.getPrimarySidemenuOptions(true, false);
fixture.detectChanges();
expect(result.length).toBe(4);
result.forEach((option, index) => {
Expand All @@ -271,7 +271,7 @@ describe('SidemenuComponent', () => {
route: ['/', 'enterprise', 'personal_cards'],
},
]);
const result = component.getPrimarySidemenuOptions(true);
const result = component.getPrimarySidemenuOptions(true, false);
fixture.detectChanges();
expect(result.length).toBe(5);
result.forEach((option, index) => {
Expand All @@ -294,7 +294,7 @@ describe('SidemenuComponent', () => {
route: ['/', 'enterprise', 'team_reports'],
},
]);
const result = component.getPrimarySidemenuOptions(true);
const result = component.getPrimarySidemenuOptions(true, false);
fixture.detectChanges();
expect(result.length).toBe(5);
result.forEach((option, index) => {
Expand Down Expand Up @@ -358,7 +358,7 @@ describe('SidemenuComponent', () => {
},
];

const result = component.getPrimarySidemenuOptions(true);
const result = component.getPrimarySidemenuOptions(true, false);
fixture.detectChanges();
expect(result.length).toBe(5);
result.forEach((option, index) => {
Expand All @@ -373,7 +373,7 @@ describe('SidemenuComponent', () => {
describe('getSecondarySidemenuOptions():', () => {
it('should get the secondary options', () => {
const resData = getSecondarySidemenuOptionsRes1;
const result = component.getSecondarySidemenuOptions(orgData1, true, true);
const result = component.getSecondarySidemenuOptions(orgData1, true, true, false);
fixture.detectChanges();
expect(result.length).toBe(4);
result.forEach((option, index) => {
Expand All @@ -386,7 +386,7 @@ describe('SidemenuComponent', () => {

it('should not show the Delegated Accounts option when there is no delegatee', () => {
const resData = getSecondarySidemenuOptionsRes1.filter((option) => option.title !== 'Delegated Accounts');
const result = component.getSecondarySidemenuOptions(orgData1, false, true);
const result = component.getSecondarySidemenuOptions(orgData1, false, true, false);
fixture.detectChanges();
expect(result.length).toBe(3);
result.forEach((option, index) => {
Expand Down Expand Up @@ -436,7 +436,7 @@ describe('SidemenuComponent', () => {
disabled: false,
},
];
const result = component.getSecondarySidemenuOptions(orgData2, true, true);
const result = component.getSecondarySidemenuOptions(orgData2, true, true, false);
fixture.detectChanges();
expect(result.length).toBe(5);
result.forEach((option, index) => {
Expand All @@ -460,8 +460,8 @@ describe('SidemenuComponent', () => {
component.setupSideMenu(true, orgData1, true);
fixture.detectChanges();
expect(component.filteredSidemenuList).toEqual(resData);
expect(getPrimarySidemenuOptionsSpy).toHaveBeenCalledOnceWith(true);
expect(getSecondarySidemenuOptionsSpy).toHaveBeenCalledOnceWith(orgData1, true, true);
expect(getPrimarySidemenuOptionsSpy).toHaveBeenCalledOnceWith(true, false);
expect(getSecondarySidemenuOptionsSpy).toHaveBeenCalledOnceWith(orgData1, true, true, false);
});

it('should only get the primary options when there is no internet connection', () => {
Expand Down

0 comments on commit 42958d0

Please sign in to comment.