test: update test

pull/1845/head
tanjinzhou 2020-03-02 18:13:30 +08:00
parent 35ffd2b4a7
commit 9f7d24dd96
6 changed files with 7 additions and 5 deletions

View File

@ -2,6 +2,6 @@ import warning, { resetWarned } from '../vc-util/warning';
export { resetWarned }; export { resetWarned };
export default (valid, component, message) => { export default (valid, component, message = '') => {
warning(valid, `[antdv: ${component}] ${message}`); warning(valid, `[antdv: ${component}] ${message}`);
}; };

View File

@ -298,7 +298,7 @@ describe('Cascader', () => {
expect($$('.ant-cascader-menu-item').length).toBe(2); expect($$('.ant-cascader-menu-item').length).toBe(2);
}, 0); }, 0);
expect(errorSpy).toBeCalledWith( expect(errorSpy).toBeCalledWith(
"Warning: 'limit' of showSearch in Cascader should be positive number or false.", "Warning: [antdv: Cascader] 'limit' of showSearch in Cascader should be positive number or false.",
); );
}); });
}); });

View File

@ -328,6 +328,7 @@ const Cascader = {
} else { } else {
warning( warning(
typeof limit !== 'number', typeof limit !== 'number',
'Cascader',
"'limit' of showSearch in Cascader should be positive number or false.", "'limit' of showSearch in Cascader should be positive number or false.",
); );
filtered = flattenOptions.filter(path => filter(inputValue, path, names)); filtered = flattenOptions.filter(path => filter(inputValue, path, names));

View File

@ -92,7 +92,7 @@ describe('Descriptions', () => {
}, },
}); });
expect(errorSpy).toHaveBeenCalledWith( expect(errorSpy).toHaveBeenCalledWith(
'Warning: [ant-design-vue: Descriptions] Sum of column `span` in a line exceeds `column` of Descriptions.', 'Warning: [antdv: Descriptions] Sum of column `span` in a line exceeds `column` of Descriptions.',
); );
}); });

View File

@ -87,7 +87,8 @@ const generateChildrenRows = (children, column) => {
warning( warning(
leftSpans === 0 && lastSpanSame, leftSpans === 0 && lastSpanSame,
'[ant-design-vue: Descriptions] Sum of column `span` in a line exceeds `column` of Descriptions.', 'Descriptions',
'Sum of column `span` in a line exceeds `column` of Descriptions.',
); );
} }
}); });

View File

@ -60,7 +60,7 @@ export default {
beforeDestroy() { beforeDestroy() {
if (this.resizeObserver) { if (this.resizeObserver) {
this.resizeObserver.remove(); this.resizeObserver.disconnect();
} }
if (this.debouncedResize && this.debouncedResize.cancel) { if (this.debouncedResize && this.debouncedResize.cancel) {
this.debouncedResize.cancel(); this.debouncedResize.cancel();