Browse Source

test: check last element returned by insertElement

pull/3586/head
Arman Ozak 7 years ago
parent
commit
2a8f5ebf24
  1. 10
      npm/ng-packs/packages/core/src/lib/tests/content.strategy.spec.ts

10
npm/ng-packs/packages/core/src/lib/tests/content.strategy.spec.ts

@ -1,9 +1,9 @@
import { import {
CONTENT_SECURITY_STRATEGY,
CONTENT_STRATEGY, CONTENT_STRATEGY,
StyleContentStrategy,
ScriptContentStrategy,
DOM_STRATEGY, DOM_STRATEGY,
CONTENT_SECURITY_STRATEGY, ScriptContentStrategy,
StyleContentStrategy,
} from '../strategies'; } from '../strategies';
import { uuid } from '../utils'; import { uuid } from '../utils';
@ -26,8 +26,8 @@ describe('StyleContentStrategy', () => {
domStrategy.insertElement = jest.fn((el: HTMLScriptElement) => {}) as any; domStrategy.insertElement = jest.fn((el: HTMLScriptElement) => {}) as any;
const strategy = new StyleContentStrategy('', domStrategy, contentSecurityStrategy); const strategy = new StyleContentStrategy('', domStrategy, contentSecurityStrategy);
const element = strategy.createElement(); strategy.createElement();
strategy.insertElement(); const element = strategy.insertElement();
expect(contentSecurityStrategy.applyCSP).toHaveBeenCalledWith(element); expect(contentSecurityStrategy.applyCSP).toHaveBeenCalledWith(element);
expect(domStrategy.insertElement).toHaveBeenCalledWith(element); expect(domStrategy.insertElement).toHaveBeenCalledWith(element);

Loading…
Cancel
Save