This repository has been archived by the owner on Apr 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update page change event to appcues (#302)
* Update page change event to appcues * update cov * Appcues added to QBO --------- Co-authored-by: ruuushhh <[email protected]>
- Loading branch information
1 parent
587b4e8
commit 85c955c
Showing
5 changed files
with
93 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { TestBed } from '@angular/core/testing'; | ||
|
||
import { AppcuesService } from './appcues.service'; | ||
import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; | ||
import { of } from 'rxjs'; | ||
import { user } from 'src/app/integration/main/dashboard/dashboard.fixture'; | ||
import { UserService } from '../misc/user.service'; | ||
|
||
describe('AppcuesService', () => { | ||
let service: AppcuesService; | ||
|
||
beforeEach(() => { | ||
const service2 = { | ||
getUserProfile: () => of(user) | ||
}; | ||
TestBed.configureTestingModule({ | ||
imports: [HttpClientTestingModule], | ||
providers: [AppcuesService, | ||
{ provide: UserService, useValue: service2 } | ||
] | ||
}); | ||
service = TestBed.inject(AppcuesService); | ||
(window as any).Appcues = { | ||
identify: () => undefined | ||
}; | ||
}); | ||
|
||
it('should be created', () => { | ||
expect(service).toBeTruthy(); | ||
}); | ||
|
||
it('get function check', () => { | ||
expect(service.appcues).toBeDefined(); | ||
}); | ||
|
||
it('initialiseAppcues function check', () => { | ||
// @ts-ignore: force this private property value for testing. | ||
expect(service.initialiseAppcues()).toBeUndefined(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { UserService } from '../misc/user.service'; | ||
import { WorkspaceService } from '../workspace/workspace.service'; | ||
|
||
@Injectable({ | ||
providedIn: 'root' | ||
}) | ||
export class AppcuesService { | ||
|
||
constructor( | ||
private userService: UserService, | ||
private workspaceService: WorkspaceService | ||
) { } | ||
|
||
get appcues() { | ||
return (window as any).Appcues; | ||
} | ||
|
||
initialiseAppcues(): void { | ||
if (this.appcues) { | ||
const user = this.userService.getUserProfile(); | ||
this.appcues.identify(user.user_id, { | ||
email: user.email, | ||
name: user.full_name, | ||
'Org ID': user.org_id, | ||
'Workspace ID': this.workspaceService.getWorkspaceId(), | ||
'Workspace Name': user.org_name, | ||
source: 'Fyle Quickbooks Integration - 2' | ||
}); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters