Skip to content

Commit 37ea404

Browse files
Merge pull request #20986 from dannon/fix-gridlist-tests
Fix jest tests -- wait for async calls in grid list
2 parents c0e686a + 26ae815 commit 37ea404

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

client/src/components/Grid/GridList.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ describe("GridList", () => {
140140
const wrapper = createTarget({
141141
gridConfig: testGrid,
142142
});
143-
await wrapper.vm.$nextTick();
143+
await flushPromises();
144144
for (const [fieldIndex, field] of Object.entries(testGrid.fields)) {
145145
expect(wrapper.find(`[data-description='grid header ${fieldIndex}']`).text()).toBe(field.title);
146146
}
@@ -150,7 +150,7 @@ describe("GridList", () => {
150150
const wrapper = createTarget({
151151
gridConfig: testGrid,
152152
});
153-
await wrapper.vm.$nextTick();
153+
await flushPromises();
154154
const dropdown = wrapper.find("[data-description='grid cell 0-2']");
155155
const dropdownItems = dropdown.findAll(".dropdown-item");
156156
expect(dropdownItems.at(0).text()).toBe("operation-title-1");
@@ -186,7 +186,7 @@ describe("GridList", () => {
186186
gridConfig: testGrid,
187187
limit: 2,
188188
});
189-
await wrapper.vm.$nextTick();
189+
await flushPromises();
190190
const pageLinks = wrapper.findAll(".page-link");
191191
await pageLinks.at(4).trigger("click");
192192
expect(wrapper.find("[data-description='grid cell 0-0']").text()).toBe("id-5");

0 commit comments

Comments
 (0)