This commit is contained in:
Martin McKeaveney 2020-08-11 12:19:37 +01:00
parent f1be92bd41
commit 5173ee8583
2 changed files with 2 additions and 39 deletions

View File

@ -28,7 +28,8 @@
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/internals/mocks/fileMock.js",
"\\.(css|less|sass|scss)$": "identity-obj-proxy",
"components(.*)$": "<rootDir>/src/components$1",
"builderStore(.*)$": "<rootDir>/src/builderStore$1"
"builderStore(.*)$": "<rootDir>/src/builderStore$1",
"constants(.*)$": "<rootDir>/src/constants$1"
},
"moduleFileExtensions": [
"js",

View File

@ -1,38 +0,0 @@
import "@testing-library/jest-dom/extend-expect"
import { render, fireEvent } from "@testing-library/svelte"
import CreateEditColumn from "../CreateEditColumn.svelte";
const testField = {
field: {},
name: "Yeet"
};
describe("<CreateEditColumn />", () => {
describe("New Column", () => {
it("shows proper heading when rendered", () => {
const { getByText } = render(CreateEditColumn, { name: 'World' })
expect(getByText('Hello World!')).toBeInTheDocument()
})
})
describe("Edit Existing Column", () => {
const { getByText } = render(CreateEditColumn, testField)
})
})
// // Note: This is as an async test as we are using `fireEvent`
// test('changes button text on click', async () => {
// const { getByText } = render(Comp, { name: 'World' })
// const button = getByText('Button')
// // Using await when firing events is unique to the svelte testing library because
// // we have to wait for the next `tick` so that Svelte flushes all pending state changes.
// await fireEvent.click(button)
// expect(button).toHaveTextContent('Button Clicked')
// })