diff --git a/client/src/components/Grid/GridList.test.js b/client/src/components/Grid/GridList.test.js new file mode 100644 index 000000000000..4b70d7528d67 --- /dev/null +++ b/client/src/components/Grid/GridList.test.js @@ -0,0 +1,29 @@ +import { mount } from "@vue/test-utils"; +import { getLocalVue } from "tests/jest/helpers"; + +import MountTarget from "./GridList.vue"; + +const localVue = getLocalVue(); + +function createTarget(propsData) { + return mount(MountTarget, { + localVue, + propsData, + stubs: { + Icon: true, + }, + }); +} + +describe("GridList", () => { + it("basic rendering", async () => { + const wrapper = createTarget({ + id: "visualizations", + }); + const findInput = wrapper.find("[data-description='filter text input']"); + expect(findInput.attributes().placeholder).toBe("search visualization"); + expect(wrapper.find(".loading-message").text()).toBe("Loading..."); + const findAction = wrapper.find("[data-description='grid action create']"); + expect(findAction.text()).toBe("Create"); + }); +}); diff --git a/client/src/components/Grid/GridList.vue b/client/src/components/Grid/GridList.vue index e67017e1b6dd..4d9b13eb049d 100644 --- a/client/src/components/Grid/GridList.vue +++ b/client/src/components/Grid/GridList.vue @@ -169,7 +169,7 @@ watch(operationMessage, () => { { class="m-1" size="sm" variant="primary" + :data-description="`grid action ${action.title.toLowerCase()}`" @click="action.handler(router)"> - - Create + + {{ action.title }} @@ -199,8 +200,8 @@ watch(operationMessage, () => { {{ fieldEntry.title || fieldEntry.key }} - - + +