本文整理汇总了TypeScript中jasmine-marbles.hot函数的典型用法代码示例。如果您正苦于以下问题:TypeScript hot函数的具体用法?TypeScript hot怎么用?TypeScript hot使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了hot函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('ExportReport should dispatch a download action', () => {
const type = 'csv';
actions = hot('a', { a: new Actions.ExportReport(type) });
const expected = hot('c', {
c: new Actions.DownloadExportedReport(
`api/report/${reportId}/download_file/${type}/`
),
});
expect(effects.exportReport$).toBeObservable(expected);
});
示例2: it
it('should return a new SearchCandidatesAction with the valid CandidateSearchFilter payload', () => {
const action = createRouterNavigationAction('/candidate-search', { 'searchFilter': testFilter });
actions$ = hot('-a', { a: action });
const searchCandidatesAction = new SearchCandidatesAction({
skills: [],
languageSkills: [
{ code: 'de', written: 1, spoken: 1 }
],
workload: [30, 100],
occupations: null,
graduation: null,
residence: ['AG', 'AI', 'GE'],
experience: null,
workplace: [{
type: 'locality',
code: 'ZH:ZH08',
label: 'Berg am Irchel',
order: 0
}] as Array<TypeaheadMultiselectModel>,
availability: null,
workForm: null,
degree: null,
drivingLicenceCategory: null
});
const expected = cold('-b', { b: searchCandidatesAction });
expect(effects.routerNavigation$).toBeObservable(expected);
});
示例3: it
it('should return new JobListLoadedAction if store is in initial state', () => {
const jobList = [
{
id: '0',
externalId: 'extId0',
title: 'title-0',
source: 'api',
publicationEndDate: new Date()
}
];
const responseWrapper = new ResponseWrapper(new Headers({ 'X-Total-Count': '100' }), jobList, 200);
actions$ = hot('-a', { a: action });
const response = cold('-a|', { a: responseWrapper });
mockJobService.search.and.returnValue(response);
const jobListLoadedAction = new actions.JobListLoadedAction({
jobList,
totalCount: 100,
page: 0
});
const expected = cold('--b|', { b: jobListLoadedAction });
expect(effects.initJobSearch$).toBeObservable(expected);
});
示例4: it
it('should return a new JobPublicationLoadedAction with the loaded job publication on success', () => {
const id = 'id';
const accessToken = 'access-token';
const action = new LoadJobPublicationAction({ id, accessToken });
actions$ = hot('-a', { a: action });
const jobPublication = {
id,
idAvam: 'id-avam',
accessToken,
job: null,
company: null,
contact: null,
application: null,
publication: null,
creationDate: 'aa',
locale: Locale.DE,
status: Status.INITIAL
};
const response = cold('-a|', { a: jobPublication });
mockJobPublicationService.findByIdAndAccessToken.and.returnValue(response);
const jobPublicationLoadedAction = new JobPublicationLoadedAction(jobPublication);
const expected = cold('--b', { b: jobPublicationLoadedAction });
expect(effects.loadJobPublication$).toBeObservable(expected);
});
示例5: it
it('should dispatch LoadPaiAfterNewFilterSuccessAction when ChangeLayerOfFilterAction dispatched', () => {
const response = {
name: 'base',
children: [{
name: 'שקל חדש',
size: 761528.092,
}, {
name: 'אירו',
size: 18448.151,
}, {
name: 'יין יפני',
size: 2792.143,
}, {
name: 'לירה שטרלינג',
size: 3424.247,
}, {
name: 'דולר אמריקאי',
size: 374767.135,
}],
};
actions = hot('--a-', { a: new ChangeLayerOfFilterAction() });
const expected = cold('--b', {b: new LoadPaiAfterNewFilterSuccessAction(response)});
const service = createServiceStub(response);
const effectsAction = new PaiEffect(new Actions(actions), service);
expect(effectsAction.changeFilterLayer$).toBeObservable(expected);
});
示例6: it
it('should not return anything if state.occupation is falsy', () => {
const action = new LanguageChangedAction('de');
actions$ = hot('-a---', { a: action });
const expected = cold('-');
expect(effects.languageChange$).toBeObservable(expected);
});
示例7: it
it(`should not do anything if the query is an empty string`, () => {
const action = new Search('');
actions$.stream = hot('-a---', { a: action });
const expected = cold('---');
expect(effects.search$).toBeObservable(expected);
});