Skip to content

Commit eabf016

Browse files
test(widget-plugin-grid): run controller setup to all test cases
1 parent 259cacd commit eabf016

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/shared/widget-plugin-grid/src/__tests__/DatasourceController.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ describe("DatasourceController loading states", () => {
1717
provider = new GateProvider({ datasource: list.loading() });
1818
host.setup();
1919
controller = new DatasourceController(host, { gate: provider.gate });
20+
controller.setup();
2021
});
2122

2223
describe("when datasource is loading", () => {
@@ -38,7 +39,6 @@ describe("DatasourceController loading states", () => {
3839
it("isRefreshing is true after refresh call", () => {
3940
provider.setProps({ datasource: list(0) });
4041
expect(provider.gate.props.datasource.status).toBe("available");
41-
controller.setup();
4242
controller.refresh();
4343
expect(controller.isRefreshing).toBe(true);
4444
provider.setProps({ datasource: list.loading() });
@@ -60,8 +60,8 @@ describe("DatasourceController loading states", () => {
6060
provider.setProps({ datasource });
6161
});
6262

63-
it("isFirstLoad returns true and loading states return false", () => {
64-
expect(controller.isFirstLoad).toBe(true);
63+
it("All loading states return false", () => {
64+
expect(controller.isFirstLoad).toBe(false);
6565
expect(controller.isRefreshing).toBe(false);
6666
expect(controller.isFetchingNextBatch).toBe(false);
6767
});

0 commit comments

Comments
 (0)