Testing
This commit is contained in:
11
client/mocks/services/mock.api.service.ts
Normal file
11
client/mocks/services/mock.api.service.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { of } from "rxjs";
|
||||
|
||||
export class MockApiService {
|
||||
getCylinders = jest.fn().mockReturnValue(of([{ name: 'Cylinder 1' }]));
|
||||
getKeys = jest.fn().mockReturnValue(of([{ name: 'Key 1' }]));
|
||||
deleteKey = jest.fn().mockReturnValue(of({}));
|
||||
updateKey = jest.fn().mockReturnValue(
|
||||
of([])
|
||||
);
|
||||
getKeyArchive = jest.fn().mockReturnValue(of([{ name: 'Key 1' }]));
|
||||
}
|
||||
11
client/mocks/services/mock.hottoast.service.ts
Normal file
11
client/mocks/services/mock.hottoast.service.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { map } from "rxjs";
|
||||
|
||||
jest.mock('@ngxpert/hot-toast', () => ({
|
||||
HotToastService: {
|
||||
observe: jest.fn().mockImplementation(() => map(x => x))
|
||||
},
|
||||
}));
|
||||
|
||||
export class MockHotToastService {
|
||||
observe = jest.fn().mockImplementation(() => map(x => x))
|
||||
};
|
||||
Reference in New Issue
Block a user