Skip to content

Commit 690b18d

Browse files
committed
tests(core): add app config service tests
1 parent bbb9109 commit 690b18d

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { createHttpFactory, HttpMethod, SpectatorHttp } from '@ngneat/spectator/jest';
2+
import { ApplicationConfigurationService, RestService } from '../services';
3+
import { Store } from '@ngxs/store';
4+
5+
describe('ApplicationConfigurationService', () => {
6+
let spectator: SpectatorHttp<ApplicationConfigurationService>;
7+
const createHttp = createHttpFactory({
8+
dataService: ApplicationConfigurationService,
9+
providers: [RestService],
10+
mocks: [Store],
11+
});
12+
13+
beforeEach(() => (spectator = createHttp()));
14+
15+
it('can test HttpClient.get', () => {
16+
spectator.get(Store).selectSnapshot.andReturn('https://abp.io');
17+
spectator.service.getConfiguration().subscribe();
18+
spectator.expectOne('https://abp.io/api/abp/application-configuration', HttpMethod.GET);
19+
});
20+
});

0 commit comments

Comments
 (0)