Skip to content

Commit

Permalink
test: fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
hsuanxyz committed Jun 6, 2019
1 parent 81dd8c6 commit 415e3ab
Show file tree
Hide file tree
Showing 37 changed files with 96 additions and 95 deletions.
2 changes: 1 addition & 1 deletion README-zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Ant Design 的 Angular 实现,开发和服务于企业级后台产品。

## 🖥 支持环境

- Angular `^8.0.0`
- Angular `^7.0.0`
- 支持服务端渲染
- 现代浏览器,以及 Internet Explorer 11+ (使用 [polyfills](https://angular.io/guide/browser-support)
- [Electron](http://electron.atom.io/)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ English | [简体中文](README-zh_CN.md)

## 🖥 Environment Support

* Angular `^8.0.0`
* Angular `^7.0.0`
* Server-side Rendering
* Modern browsers and Internet Explorer 11+ (with [polyfills](https://angular.io/guide/browser-support))
* [Electron](http://electron.atom.io/)
Expand Down
2 changes: 1 addition & 1 deletion components/alert/nz-alert.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ describe('alert', () => {
`
})
export class NzDemoTestBasicComponent {
@ViewChild('template', { static: true }) template: TemplateRef<void>;
@ViewChild('template', { static: false }) template: TemplateRef<void>;
banner = false;
closeable = false;
closeText: string | TemplateRef<void>;
Expand Down
2 changes: 1 addition & 1 deletion components/anchor/anchor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ describe('anchor', () => {
`
})
export class TestComponent {
@ViewChild(NzAnchorComponent, { static: true }) comp: NzAnchorComponent;
@ViewChild(NzAnchorComponent, { static: false }) comp: NzAnchorComponent;
nzAffix = true;
nzBounds = 5;
nzOffsetTop = 0;
Expand Down
16 changes: 8 additions & 8 deletions components/auto-complete/nz-autocomplete.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -844,8 +844,8 @@ class NzTestSimpleAutocompleteComponent {
inputControl = new FormControl();
options: Array<string | number> = ['Burns Bay Road', 'Downing Street', 'Wall Street'];

@ViewChild(NzAutocompleteComponent, { static: true }) panel: NzAutocompleteComponent;
@ViewChild(NzAutocompleteTriggerDirective, { static: true }) trigger: NzAutocompleteTriggerDirective;
@ViewChild(NzAutocompleteComponent, { static: false }) panel: NzAutocompleteComponent;
@ViewChild(NzAutocompleteTriggerDirective, { static: false }) trigger: NzAutocompleteTriggerDirective;
@ViewChildren(NzAutocompleteOptionComponent) optionComponents: QueryList<NzAutocompleteOptionComponent>;

constructor() {
Expand Down Expand Up @@ -880,8 +880,8 @@ class NzTestAutocompletePropertyComponent {
overlayClassName = '';
overlayStyle = {};
options = ['Burns Bay Road', 'Downing Street', 'Wall Street'];
@ViewChild(NzAutocompleteComponent, { static: true }) panel: NzAutocompleteComponent;
@ViewChild(NzAutocompleteTriggerDirective, { static: true }) trigger: NzAutocompleteTriggerDirective;
@ViewChild(NzAutocompleteComponent, { static: false }) panel: NzAutocompleteComponent;
@ViewChild(NzAutocompleteTriggerDirective, { static: false }) trigger: NzAutocompleteTriggerDirective;

constructor() {}
}
Expand All @@ -892,7 +892,7 @@ class NzTestAutocompletePropertyComponent {
`
})
class NzTestAutocompleteWithoutPanelComponent {
@ViewChild(NzAutocompleteTriggerDirective, { static: true }) trigger: NzAutocompleteTriggerDirective;
@ViewChild(NzAutocompleteTriggerDirective, { static: false }) trigger: NzAutocompleteTriggerDirective;
}

@Component({
Expand All @@ -906,7 +906,7 @@ class NzTestAutocompleteWithoutPanelComponent {
})
class NzTestAutocompleteWithOnPushDelayComponent implements OnInit {
options: string[] = [];
@ViewChild(NzAutocompleteTriggerDirective, { static: true }) trigger: NzAutocompleteTriggerDirective;
@ViewChild(NzAutocompleteTriggerDirective, { static: false }) trigger: NzAutocompleteTriggerDirective;

ngOnInit(): void {
setTimeout(() => {
Expand Down Expand Up @@ -975,7 +975,7 @@ class NzTestAutocompleteGroupComponent {
}
];

@ViewChild(NzAutocompleteTriggerDirective, { static: true }) trigger: NzAutocompleteTriggerDirective;
@ViewChild(NzAutocompleteTriggerDirective, { static: false }) trigger: NzAutocompleteTriggerDirective;
}

@Component({
Expand All @@ -991,7 +991,7 @@ class NzTestAutocompleteGroupComponent {
class NzTestAutocompleteWithFormComponent {
form: FormGroup;
options = ['Burns Bay Road', 'Downing Street', 'Wall Street'];
@ViewChild(NzAutocompleteTriggerDirective, { static: true }) trigger: NzAutocompleteTriggerDirective;
@ViewChild(NzAutocompleteTriggerDirective, { static: false }) trigger: NzAutocompleteTriggerDirective;

constructor(private fb: FormBuilder) {
this.form = this.fb.group({ formControl: 'Burns' });
Expand Down
2 changes: 1 addition & 1 deletion components/avatar/avatar.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ describe('avatar', () => {
styleUrls: ['./style/index.less']
})
class TestAvatarComponent {
@ViewChild('comp', { static: true }) comp: NzAvatarComponent;
@ViewChild('comp', { static: false }) comp: NzAvatarComponent;
nzShape = 'square';
nzSize: string | number = 'large';
nzIcon: string | null = 'anticon anticon-user';
Expand Down
2 changes: 1 addition & 1 deletion components/back-top/back-top.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ class TestBackTopComponent {
`
})
class TestBackTopTemplateComponent {
@ViewChild(NzBackTopComponent, { static: true })
@ViewChild(NzBackTopComponent, { static: false })
nzBackTopComponent: NzBackTopComponent;
}

Expand Down
2 changes: 1 addition & 1 deletion components/carousel/nz-carousel.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import { NzCarouselOpacityStrategy } from './strategies/opacity-strategy';
`
})
export class NzTestCarouselBasicComponent {
@ViewChild(NzCarouselComponent, { static: true }) nzCarouselComponent: NzCarouselComponent;
@ViewChild(NzCarouselComponent, { static: false }) nzCarouselComponent: NzCarouselComponent;
dots = true;
vertical = false;
effect = 'scrollx';
Expand Down
2 changes: 1 addition & 1 deletion components/checkbox/nz-checkbox.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ describe('checkbox', () => {
`
})
export class NzTestCheckboxSingleComponent {
@ViewChild(NzCheckboxComponent, { static: true }) nzCheckboxComponent: NzCheckboxComponent;
@ViewChild(NzCheckboxComponent, { static: false }) nzCheckboxComponent: NzCheckboxComponent;
disabled = false;
autoFocus = false;
checked = false;
Expand Down
2 changes: 1 addition & 1 deletion components/collapse/nz-collapse.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ describe('collapse', () => {
`
})
export class NzTestCollapseBasicComponent {
@ViewChild('headerTemplate', { static: true }) headerTemplate: TemplateRef<void>;
@ViewChild('headerTemplate', { static: false }) headerTemplate: TemplateRef<void>;
accordion = false;
bordered = true;
disabled = false;
Expand Down
4 changes: 2 additions & 2 deletions components/core/wave/nz-wave.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ class WaveContainerWithButtonComponent {
borderColor = 'rgb(0,255,0)';
backgroundColor = 'rgb(255,255,255)';
@ViewChild('trigger', { static: false }) trigger: ElementRef<HTMLElement>;
@ViewChild(NzWaveDirective, { static: true }) wave: NzWaveDirective;
@ViewChild(NzWaveDirective, { static: false }) wave: NzWaveDirective;
}

@Component({
Expand All @@ -283,5 +283,5 @@ class WaveContainerWithExtraNodeComponent {
borderColor = 'rgb(0,255,0)';
backgroundColor = 'rgb(255,255,255)';
@ViewChild('trigger', { static: false }) trigger: ElementRef<HTMLElement>;
@ViewChild(NzWaveDirective, { static: true }) wave: NzWaveDirective;
@ViewChild(NzWaveDirective, { static: false }) wave: NzWaveDirective;
}
2 changes: 1 addition & 1 deletion components/divider/divider.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ describe('divider', () => {
`
})
class TestDividerComponent {
@ViewChild('comp', { static: true }) comp: NzDividerComponent;
@ViewChild('comp', { static: false }) comp: NzDividerComponent;
nzDashed = false;
nzType = 'horizontal';
nzText?: string = 'with text';
Expand Down
6 changes: 3 additions & 3 deletions components/drawer/nz-drawer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -526,9 +526,9 @@ class NzTestDrawerComponent {
placement = 'left';
offsetX = 0;
offsetY = 0;
@ViewChild('customTitle', { static: true }) templateTitle: TemplateRef<void>;
@ViewChild('customTitle', { static: false }) templateTitle: TemplateRef<void>;

@ViewChild(NzDrawerComponent, { static: true }) drawerComponent: NzDrawerComponent;
@ViewChild(NzDrawerComponent, { static: false }) drawerComponent: NzDrawerComponent;

open(): void {
this.visible = true;
Expand All @@ -548,7 +548,7 @@ class NzTestDrawerComponent {
`
})
class NzTestDrawerWithServiceComponent {
@ViewChild('drawerTemplate', { static: true }) drawerTemplate: TemplateRef<{
@ViewChild('drawerTemplate', { static: false }) drawerTemplate: TemplateRef<{
$implicit: number;
drawerRef: NzDrawerRef;
}>;
Expand Down
4 changes: 2 additions & 2 deletions components/dropdown/nz-dropdown.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -457,9 +457,9 @@ describe('dropdown', () => {
styles: []
})
export class NzTestDropdownComponent {
@ViewChild(NzDropDownComponent, { static: true }) nzDropDownComponent: NzDropDownComponent;
@ViewChild(NzDropDownComponent, { static: false }) nzDropDownComponent: NzDropDownComponent;
@ViewChild(NzDropDownDirective, { static: true }) nzDropDownDirective: NzDropDownDirective;
@ViewChild(NzSubMenuComponent, { static: true }) nzSubMenuComponent: NzSubMenuComponent;
@ViewChild(NzSubMenuComponent, { static: false }) nzSubMenuComponent: NzSubMenuComponent;
visible = false;
selectable = true;
itemSelected = false;
Expand Down
8 changes: 4 additions & 4 deletions components/empty/nz-empty.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,9 +301,9 @@ describe('nz-empty', () => {
`
})
export class NzEmptyTestBasicComponent {
@ViewChild('imageTpl', { static: true }) imageTpl: TemplateRef<void>;
@ViewChild('contentTpl', { static: true }) contentTpl: TemplateRef<void>;
@ViewChild('footerTpl', { static: true }) footerTpl: TemplateRef<void>;
@ViewChild('imageTpl', { static: false }) imageTpl: TemplateRef<void>;
@ViewChild('contentTpl', { static: false }) contentTpl: TemplateRef<void>;
@ViewChild('footerTpl', { static: false }) footerTpl: TemplateRef<void>;

image?: TemplateRef<void> | string;
content?: TemplateRef<void> | string;
Expand All @@ -320,7 +320,7 @@ export class NzEmptyTestBasicComponent {
`
})
export class NzEmptyTestServiceComponent {
@ViewChild('tpl', { static: true }) template: TemplateRef<void>;
@ViewChild('tpl', { static: false }) template: TemplateRef<void>;

noResult?: string | null;

Expand Down
2 changes: 1 addition & 1 deletion components/input-number/nz-input-number.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ describe('input number', () => {
`
})
export class NzTestInputNumberBasicComponent {
@ViewChild(NzInputNumberComponent, { static: true }) nzInputNumberComponent: NzInputNumberComponent;
@ViewChild(NzInputNumberComponent, { static: false }) nzInputNumberComponent: NzInputNumberComponent;
value?: number | string;
autofocus = false;
disabled = false;
Expand Down
8 changes: 4 additions & 4 deletions components/input/nz-input-group.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@ describe('input-group', () => {
`
})
export class NzTestInputGroupAddonComponent {
@ViewChild('beforeTemplate', { static: true }) beforeTemplate: TemplateRef<void>;
@ViewChild('afterTemplate', { static: true }) afterTemplate: TemplateRef<void>;
@ViewChild('beforeTemplate', { static: false }) beforeTemplate: TemplateRef<void>;
@ViewChild('afterTemplate', { static: false }) afterTemplate: TemplateRef<void>;
beforeContent: string | TemplateRef<void>;
afterContent: string | TemplateRef<void>;
size = 'default';
Expand All @@ -250,8 +250,8 @@ export class NzTestInputGroupAddonComponent {
`
})
export class NzTestInputGroupAffixComponent {
@ViewChild('beforeTemplate', { static: true }) beforeTemplate: TemplateRef<void>;
@ViewChild('afterTemplate', { static: true }) afterTemplate: TemplateRef<void>;
@ViewChild('beforeTemplate', { static: false }) beforeTemplate: TemplateRef<void>;
@ViewChild('afterTemplate', { static: false }) afterTemplate: TemplateRef<void>;
beforeContent: string | TemplateRef<void>;
afterContent: string | TemplateRef<void>;
size = 'default';
Expand Down
4 changes: 2 additions & 2 deletions components/list/list.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ describe('list', () => {
`
})
class TestListComponent {
@ViewChild('comp', { static: true }) comp: NzListComponent;
@ViewChild('comp', { static: false }) comp: NzListComponent;
nzItemLayout = 'horizontal';
nzBordered = false;
nzFooter = 'footer';
Expand Down Expand Up @@ -253,7 +253,7 @@ class TestListComponent {
`
})
class TestListWithTemplateComponent {
@ViewChild('nzFooter', { static: true }) nzFooter: TemplateRef<void>;
@ViewChild('nzFooter', { static: false }) nzFooter: TemplateRef<void>;

footer: string | TemplateRef<void> = 'footer with string';
}
Expand Down
8 changes: 4 additions & 4 deletions components/mention/nz-mention.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -442,8 +442,8 @@ describe('mention', () => {
class NzTestSimpleMentionComponent {
inputValue: string = '@angular';
suggestions = ['angular', 'ant-design', 'mention', '中文', 'にほんご'];
@ViewChild(NzMentionComponent, { static: true }) mention: NzMentionComponent;
@ViewChild(NzMentionTriggerDirective, { static: true }) trigger: NzMentionTriggerDirective;
@ViewChild(NzMentionComponent, { static: false }) mention: NzMentionComponent;
@ViewChild(NzMentionTriggerDirective, { static: false }) trigger: NzMentionTriggerDirective;
}

@Component({
Expand Down Expand Up @@ -475,8 +475,8 @@ class NzTestPropertyMentionComponent {
loading = false;
prefix: string | string[] = '@';
valueWith = (data: { name: string; type: string }) => data.name;
@ViewChild(NzMentionComponent, { static: true }) mention: NzMentionComponent;
@ViewChild(NzMentionTriggerDirective, { static: true }) trigger: NzMentionTriggerDirective;
@ViewChild(NzMentionComponent, { static: false }) mention: NzMentionComponent;
@ViewChild(NzMentionTriggerDirective, { static: false }) trigger: NzMentionTriggerDirective;

setArrayPrefix(): void {
this.prefix = ['@', '#'];
Expand Down
2 changes: 1 addition & 1 deletion components/pagination/nz-pagination.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ describe('pagination', () => {
`
})
export class NzTestPaginationComponent {
@ViewChild(NzPaginationComponent, { static: true }) nzPaginationComponent: NzPaginationComponent;
@ViewChild(NzPaginationComponent, { static: false }) nzPaginationComponent: NzPaginationComponent;
pageIndex = 1;
pageSize = 10;
total = 50;
Expand Down
20 changes: 10 additions & 10 deletions components/popconfirm/nz-popconfirm.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,10 +318,10 @@ export class NzpopconfirmTestNewComponent {
cancel = jasmine.createSpy('cancel');
condition = false;
icon: string | undefined = undefined;
@ViewChild('stringTemplate', { static: true }) stringTemplate: ElementRef;
@ViewChild('templateTemplate', { static: true }) templateTemplate: ElementRef;
@ViewChild('inBtnGroup', { static: true }) inBtnGroup: ElementRef;
@ViewChild('iconTemplate', { static: true }) iconTemplate: ElementRef;
@ViewChild('stringTemplate', { static: false }) stringTemplate: ElementRef;
@ViewChild('templateTemplate', { static: false }) templateTemplate: ElementRef;
@ViewChild('inBtnGroup', { static: false }) inBtnGroup: ElementRef;
@ViewChild('iconTemplate', { static: false }) iconTemplate: ElementRef;
}

@Component({
Expand Down Expand Up @@ -357,19 +357,19 @@ export class NzpopconfirmTestNewComponent {
export class NzpopconfirmTestWrapperComponent {
nzOkType = 'primary';

@ViewChild('normalTrigger', { static: true }) normalTrigger: ElementRef;
@ViewChild('normalTrigger', { static: false }) normalTrigger: ElementRef;

@ViewChild('templateTrigger', { static: true }) templateTrigger: ElementRef;
@ViewChild('templateTrigger', { static: false }) templateTrigger: ElementRef;

@ViewChild('focusTrigger', { static: true }) focusTrigger: ElementRef;
@ViewChild('focusTrigger', { static: false }) focusTrigger: ElementRef;

@ViewChild('clickTrigger', { static: true }) clickTrigger: ElementRef;
@ViewChild('clickTrigger', { static: false }) clickTrigger: ElementRef;

visible: boolean;
@ViewChild('visibleTrigger', { static: true }) visibleTrigger: ElementRef;
@ViewChild('visibleTrigger', { static: false }) visibleTrigger: ElementRef;

executeCondition: boolean;
@ViewChild('executeTrigger', { static: true }) executeTrigger: ElementRef;
@ViewChild('executeTrigger', { static: false }) executeTrigger: ElementRef;

onConfirm(): void {}

Expand Down
16 changes: 8 additions & 8 deletions components/popover/nz-popover.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,13 +209,13 @@ describe('NzPopover', () => {
`
})
export class NzPopoverTestNewComponent {
@ViewChild('stringPopover', { static: true }) stringPopover: ElementRef;
@ViewChild('stringPopover', { static: false }) stringPopover: ElementRef;
@ViewChild('stringPopover', { static: false, read: NzPopoverDirective })
stringPopoverNzPopoverDirective: NzPopoverDirective;
@ViewChild('templatePopover', { static: true }) templatePopover: ElementRef;
@ViewChild('templatePopover', { static: false }) templatePopover: ElementRef;
@ViewChild('templatePopover', { static: false, read: NzPopoverDirective })
templatePopoverNzPopoverDirective: NzPopoverDirective;
@ViewChild('inBtnGroup', { static: true }) inBtnGroup: ElementRef;
@ViewChild('inBtnGroup', { static: false }) inBtnGroup: ElementRef;
}

@Component({
Expand All @@ -236,14 +236,14 @@ export class NzPopoverTestNewComponent {
`
})
export class NzPopoverTestWrapperComponent {
@ViewChild('normalTrigger', { static: true }) normalTrigger: ElementRef;
@ViewChild('normalTrigger', { static: false }) normalTrigger: ElementRef;

@ViewChild('templateTrigger', { static: true }) templateTrigger: ElementRef;
@ViewChild('templateTrigger', { static: false }) templateTrigger: ElementRef;

@ViewChild('focusTrigger', { static: true }) focusTrigger: ElementRef;
@ViewChild('focusTrigger', { static: false }) focusTrigger: ElementRef;

@ViewChild('clickTrigger', { static: true }) clickTrigger: ElementRef;
@ViewChild('clickTrigger', { static: false }) clickTrigger: ElementRef;

visible: boolean;
@ViewChild('visibleTrigger', { static: true }) visibleTrigger: ElementRef;
@ViewChild('visibleTrigger', { static: false }) visibleTrigger: ElementRef;
}
2 changes: 1 addition & 1 deletion components/radio/nz-radio.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ describe('radio', () => {
`
})
export class NzTestRadioSingleComponent {
@ViewChild(NzRadioComponent, { static: true }) nzRadioComponent: NzRadioComponent;
@ViewChild(NzRadioComponent, { static: false }) nzRadioComponent: NzRadioComponent;
value = false;
autoFocus = false;
disabled = false;
Expand Down
2 changes: 1 addition & 1 deletion components/rate/nz-rate.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ describe('rate', () => {
`
})
export class NzTestRateBasicComponent {
@ViewChild(NzRateComponent, { static: true }) nzRateComponent: NzRateComponent;
@ViewChild(NzRateComponent, { static: false }) nzRateComponent: NzRateComponent;
count = 5;
autoFocus = false;
allowHalf = false;
Expand Down
Loading

0 comments on commit 415e3ab

Please sign in to comment.