Skip to content

Commit

Permalink
fix: update TemplateService tests
Browse files Browse the repository at this point in the history
  • Loading branch information
raronpxcsw committed Feb 19, 2024
1 parent 212b2a4 commit 3405af4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions projects/aas-lib/src/lib/template.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ export class TemplateService {
}

/**
*
* @param descriptor
* Gets the template from the specified endpoint.
* @param endpoint The template endpoint.
* @returns The template.
*/
public getTemplate(endpoint: Endpoint): Observable<aas.Referable> {
return this.http.get<aas.Referable>(`/api/v1/templates/${encodeBase64Url(endpoint.address)}`);
}
}
}
21 changes: 12 additions & 9 deletions projects/aas-lib/src/test/template.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,21 @@
*****************************************************************************/

import { TestBed } from '@angular/core/testing';
import { HttpClientTestingModule } from '@angular/common/http/testing';

import { TemplateService } from '../lib/template.service';

describe('TemplateService', () => {
let service: TemplateService;
let service: TemplateService;

beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(TemplateService);
});
beforeEach(() => {
TestBed.configureTestingModule({
imports: [HttpClientTestingModule],
});
service = TestBed.inject(TemplateService);
});

it('should be created', () => {
expect(service).toBeTruthy();
});
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});

0 comments on commit 3405af4

Please sign in to comment.