Skip to content

Commit 39890b9

Browse files
author
Alyar
committed
Add jest tests. Small refactoring. And fix repaintChangesOnly
1 parent 6be4fb7 commit 39890b9

File tree

4 files changed

+475
-19
lines changed

4 files changed

+475
-19
lines changed

packages/devextreme/js/__internal/grids/grid_core/__tests__/__mock__/model/grid_core.ts

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,6 @@ export abstract class GridCoreModel<TInstance extends GridBase = GridBase> {
5555
return this.root.querySelectorAll(`.${SELECTORS.groupRowClass}`);
5656
}
5757

58-
public apiColumnOption(id: string, name?: string, value?: any): any {
59-
switch (arguments.length) {
60-
case 1:
61-
return this.getInstance().columnOption(id);
62-
case 2:
63-
return this.getInstance().columnOption(id, name);
64-
default:
65-
this.getInstance().columnOption(id, name as string, value);
66-
return undefined;
67-
}
68-
}
69-
7058
public getHeaderByText(text: string): dxElementWrapper {
7159
return $(Array.from(this.getHeaderCells()).find((el) => $(el).text().includes(text)));
7260
}
@@ -97,5 +85,21 @@ export abstract class GridCoreModel<TInstance extends GridBase = GridBase> {
9785
return `dx-${componentName.slice(2).toLowerCase()}${classNames ? `-${classNames}` : ''}`;
9886
}
9987

88+
public apiColumnOption(id: string, name?: string, value?: any): any {
89+
switch (arguments.length) {
90+
case 1:
91+
return this.getInstance().columnOption(id);
92+
case 2:
93+
return this.getInstance().columnOption(id, name);
94+
default:
95+
this.getInstance().columnOption(id, name as string, value);
96+
return undefined;
97+
}
98+
}
99+
100+
public async apiRefresh(): Promise<void> {
101+
await this.getInstance().refresh();
102+
}
103+
100104
public abstract getInstance(): TInstance;
101105
}

0 commit comments

Comments
 (0)