Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- it('should be able load company data', inject([HttpClient], (http: HttpClient) => {
- const companyList: CompanyVerificationResponseDto = {
- companyName: 'testcompany',
- kvkNumber: 12345678,
- companyPhone: '0612341234',
- email: 'testtest@email.com',
- accountStatus: 0,
- contactPhone: '0631313131'
- };
- managementService.loadData();
- const headers = new HttpHeaders().set('Content-Type', 'application/json');
- const param = new HttpParams().set('token', '1234-1234-1234').append('email', 'testtest@email.com');
- const options = {params: param, headers: headers};
- http.get('http://localhost:8080/adminpage', options).subscribe(() => {
- });
- const req = httpMock.expectOne('http://localhost:8080/adminpage?token=1234-1234-1234&email=testtest@email.com');
- expect(req.request.method).toEqual('GET');
- req.flush(companyList);
- }));
- afterEach(() => {
- httpMock.verify();
- });
- public loadData() {
- this.restfulService.url = this.restfulService.getBaseUrl() + '/adminpage';
- const param = new HttpParams().set('token', this.restfulService.getLocalStorageToken().token);
- const options = {params: param, headers: this.headers};
- return this.httpClient.get<CompanyVerificationResponseDto[]>(this.restfulService.url, options).subscribe(data => {
- this.companyList = data;
- this.onSuccesfulReceivedData(data);
- },
- error => this.restfulService.handleError(error));
- }
- PhantomJS 2.1.1 (Windows 8 0.0.0) ManagementService should be able to accept a company based on email FAILED
- Error: Expected no open requests, found 1: GET http://localhost:8080/adminpage in http://localhost:9876/_karma_webpack_/vendor.js (line 32166)
- verify@http://localhost:9876/_karma_webpack_/vendor.js:32166:97
- http://localhost:9876/_karma_webpack_/main.js:3356:24
- invoke@http://localhost:9876/_karma_webpack_/polyfills.js:6843:31
- onInvoke@http://localhost:9876/_karma_webpack_/vendor.js:156148:45
- invoke@http://localhost:9876/_karma_webpack_/polyfills.js:6842:40
- run@http://localhost:9876/_karma_webpack_/polyfills.js:6593:49
- runInTestZone@http://localhost:9876/_karma_webpack_/vendor.js:156369:37
- http://localhost:9876/_karma_webpack_/vendor.js:156384:33
- invoke@http://localhost:9876/_karma_webpack_/polyfills.js:6843:31
- run@http://localhost:9876/_karma_webpack_/polyfills.js:6593:49
- http://localhost:9876/_karma_webpack_/polyfills.js:7327:37
- invokeTask@http://localhost:9876/_karma_webpack_/polyfills.js:6876:36
- runTask@http://localhost:9876/_karma_webpack_/polyfills.js:6643:57
- drainMicroTaskQueue@http://localhost:9876/_karma_webpack_/polyfills.js:7050:42
Add Comment
Please, Sign In to add comment