daily pastebin goal
0%
SHARE
TWEET

Untitled

a guest Mar 21st, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function setup({ userAgent }: { userAgent: string }) {
  2.   TestBed.overrideProvider(userAgentToken, { useValue: userAgent });
  3.  
  4.   const fixture = TestBed.createComponent(InternetExplorer11BannerComponent);
  5.   fixture.detectChanges();
  6.  
  7.   const readBannerText = () =>
  8.     (fixture.nativeElement as HTMLElement).textContent.trim();
  9.  
  10.   return {
  11.     clickDismissButton() {
  12.       const buttonDebug = fixture.debugElement.query(By.css('button'));
  13.  
  14.       buttonDebug.triggerEventHandler('click', {});
  15.       fixture.detectChanges();
  16.     },
  17.     expectBannerToBeDisplayed() {
  18.       expect(readBannerText().toLowerCase())
  19.         .toContain('please upgrade', 'Expected banner to be displayed');
  20.     },
  21.     expectBannerToBeHidden() {
  22.       expect(readBannerText()).toBe('', 'Expected banner to be hidden');
  23.     },
  24.   };
  25. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top