Skip to content

Commit

Permalink
refactor(module:tooltip,popover,popconfirm): refactor (#4721)
Browse files Browse the repository at this point in the history
* chore(module:tooltip,popover,popconfirm): refactor

chore: refactor

chore: refactor

chore: merge redundant files

chore: remove redundant files

fix: path

fix: remove unused method

fix: remove useless ng-content

fix: constructor

* feat(module:tooltip): close when title is null
  • Loading branch information
Wendell authored Feb 19, 2020
1 parent 7218525 commit d5016e4
Show file tree
Hide file tree
Showing 26 changed files with 752 additions and 845 deletions.
50 changes: 0 additions & 50 deletions components/popconfirm/nz-popconfirm.component.html

This file was deleted.

83 changes: 0 additions & 83 deletions components/popconfirm/nz-popconfirm.component.ts

This file was deleted.

99 changes: 0 additions & 99 deletions components/popconfirm/nz-popconfirm.directive.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ import { NzI18nModule } from 'ng-zorro-antd/i18n';
import { NzIconModule } from 'ng-zorro-antd/icon';
import { NzToolTipModule } from 'ng-zorro-antd/tooltip';

import { NzPopconfirmComponent } from './nz-popconfirm.component';
import { NzPopconfirmDirective } from './nz-popconfirm.directive';
import { NzPopconfirmComponent, NzPopconfirmDirective } from './popconfirm';

@NgModule({
declarations: [NzPopconfirmComponent, NzPopconfirmDirective],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
import { OverlayContainer } from '@angular/cdk/overlay';
import { Component, ElementRef, ViewChild } from '@angular/core';
import { ComponentFixture, fakeAsync, inject, TestBed, tick } from '@angular/core/testing';
import { ComponentFixture, fakeAsync, inject, tick } from '@angular/core/testing';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';

import { dispatchMouseEvent } from 'ng-zorro-antd/core';
import { ComponentBed, createComponentBed } from 'ng-zorro-antd/core/testing/componet-bed';
import { NzIconTestModule } from 'ng-zorro-antd/icon/testing';
import { NzToolTipModule } from 'ng-zorro-antd/tooltip';

import { NzPopconfirmModule } from './nz-popconfirm.module';
import { NzPopconfirmModule } from './popconfirm.module';

describe('NzPopconfirm', () => {
let testBed: ComponentBed<NzPopconfirmTestNewComponent>;
let fixture: ComponentFixture<NzPopconfirmTestNewComponent>;
let component: NzPopconfirmTestNewComponent;
let overlayContainer: OverlayContainer;
let overlayContainerElement: HTMLElement;

beforeEach(fakeAsync(() => {
TestBed.configureTestingModule({
imports: [NzPopconfirmModule, NoopAnimationsModule, NzToolTipModule, NzIconTestModule],
declarations: [NzpopconfirmTestNewComponent]
testBed = createComponentBed(NzPopconfirmTestNewComponent, {
imports: [NzPopconfirmModule, NoopAnimationsModule, NzIconTestModule]
});

TestBed.compileComponents();
fixture = testBed.fixture;
component = testBed.component;
fixture.detectChanges();
}));

beforeEach(inject([OverlayContainer], (oc: OverlayContainer) => {
Expand All @@ -31,9 +34,6 @@ describe('NzPopconfirm', () => {
overlayContainer.ngOnDestroy();
});

let fixture: ComponentFixture<NzpopconfirmTestNewComponent>;
let component: NzpopconfirmTestNewComponent;

function getTitleText(): Element | null {
return overlayContainerElement.querySelector('.ant-popover-message-title');
}
Expand All @@ -42,12 +42,6 @@ describe('NzPopconfirm', () => {
return overlayContainerElement.querySelectorAll('.ant-popover-buttons button')[index];
}

beforeEach(() => {
fixture = TestBed.createComponent(NzpopconfirmTestNewComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

function waitingForTooltipToggling(): void {
fixture.detectChanges();
tick(500);
Expand Down Expand Up @@ -145,7 +139,7 @@ describe('NzPopconfirm', () => {
<ng-template #titleTemplate>title-template</ng-template>
`
})
export class NzpopconfirmTestNewComponent {
export class NzPopconfirmTestNewComponent {
confirm = jasmine.createSpy('confirm');
cancel = jasmine.createSpy('cancel');
condition = false;
Expand Down
Loading

0 comments on commit d5016e4

Please sign in to comment.