|
7 | 7 | OverlayRef, |
8 | 8 | createOverlayRef, |
9 | 9 | createGlobalPositionStrategy, |
10 | | - GlobalPositionStrategy, |
11 | | - OverlayContainer, |
12 | 10 | } from '../index'; |
13 | 11 |
|
14 | 12 | describe('GlobalPositonStrategy', () => { |
@@ -472,50 +470,6 @@ describe('GlobalPositonStrategy', () => { |
472 | 470 | expect(elementStyle.marginRight).toBe(''); |
473 | 471 | expect(parentStyle.justifyContent).toBe('flex-end'); |
474 | 472 | }); |
475 | | - |
476 | | - describe('DOM location', () => { |
477 | | - let positionStrategy: GlobalPositionStrategy; |
478 | | - let containerElement: HTMLElement; |
479 | | - |
480 | | - beforeEach(() => { |
481 | | - containerElement = TestBed.inject(OverlayContainer).getContainerElement(); |
482 | | - positionStrategy = createGlobalPositionStrategy(injector); |
483 | | - }); |
484 | | - |
485 | | - it('should place the overlay inside the overlay container by default', () => { |
486 | | - attachOverlay({positionStrategy, usePopover: false}); |
487 | | - expect(containerElement.contains(overlayRef.hostElement)).toBe(true); |
488 | | - expect(overlayRef.hostElement.getAttribute('popover')).toBeFalsy(); |
489 | | - }); |
490 | | - |
491 | | - it('should be able to opt into placing the overlay inside a popover element', () => { |
492 | | - if (!('showPopover' in document.body)) { |
493 | | - return; |
494 | | - } |
495 | | - |
496 | | - attachOverlay({positionStrategy, usePopover: true}); |
497 | | - |
498 | | - expect(containerElement.contains(overlayRef.hostElement)).toBe(false); |
499 | | - expect(document.body.lastChild).toBe(overlayRef.hostElement); |
500 | | - expect(overlayRef.hostElement.getAttribute('popover')).toBe('manual'); |
501 | | - }); |
502 | | - |
503 | | - it('should re-attach the popover at the end of the body', () => { |
504 | | - if (!('showPopover' in document.body)) { |
505 | | - return; |
506 | | - } |
507 | | - |
508 | | - attachOverlay({positionStrategy, usePopover: true}); |
509 | | - expect(document.body.lastChild).toBe(overlayRef.hostElement); |
510 | | - |
511 | | - overlayRef.detach(); |
512 | | - TestBed.inject(ApplicationRef).tick(); |
513 | | - expect(overlayRef.hostElement.parentNode).toBeFalsy(); |
514 | | - |
515 | | - overlayRef.attach(portal); |
516 | | - expect(document.body.lastChild).toBe(overlayRef.hostElement); |
517 | | - }); |
518 | | - }); |
519 | 473 | }); |
520 | 474 |
|
521 | 475 | @Component({ |
|
0 commit comments