本文整理匯總了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);
});