本文整理汇总了TypeScript中testing/doc-viewer-utils.TestDocViewerComponent.swapViews方法的典型用法代码示例。如果您正苦于以下问题:TypeScript TestDocViewerComponent.swapViews方法的具体用法?TypeScript TestDocViewerComponent.swapViews怎么用?TypeScript TestDocViewerComponent.swapViews使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类testing/doc-viewer-utils.TestDocViewerComponent
的用法示例。
在下文中一共展示了TestDocViewerComponent.swapViews方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should abort swapping if the returned observable is unsubscribed from', async () => {
docViewer.swapViews().subscribe().unsubscribe();
await doSwapViews();
// Since the first call was cancelled, only one swapping should have taken place.
expect(docViewerEl.contains(oldCurrViewContainer)).toBe(false);
expect(docViewerEl.contains(oldNextViewContainer)).toBe(true);
expect(docViewer.currViewContainer).toBe(oldNextViewContainer);
expect(docViewer.nextViewContainer).toBe(oldCurrViewContainer);
expect(docViewer.currViewContainer.innerHTML).toBe('Next view');
expect(docViewer.nextViewContainer.innerHTML).toBe('');
});
示例2:
new Promise<void>((resolve, reject) =>
docViewer.swapViews(cb).subscribe(resolve, reject));