From 57655bf7f28800edf523bf3a93eab28a8691fa97 Mon Sep 17 00:00:00 2001 From: Yanick Champoux Date: Fri, 14 Apr 2023 14:24:21 -0400 Subject: [PATCH 1/3] add the editor --- src/routes/+page.svelte | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 1333ed7..8830a2f 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -1 +1,5 @@ -TODO + + + From 4ed175d54accb1c898c3b8cc9c7f780828c1e181 Mon Sep 17 00:00:00 2001 From: Yanick Champoux Date: Fri, 14 Apr 2023 14:29:20 -0400 Subject: [PATCH 2/3] add the test --- Taskfile.yml | 5 ++++- src/routes/page.test.js | 9 +++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 src/routes/page.test.js diff --git a/Taskfile.yml b/Taskfile.yml index e335acc..e8e2240 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -4,6 +4,7 @@ version: "3" vars: GREETING: Hello, World! + PARENT_BRANCH: main tasks: test: @@ -31,7 +32,9 @@ tasks: deps: [check] cmds: - git is-clean - - git checkout main + # did we had tests? + - git diff-ls {{.PARENT_BRANCH}} | grep test + - git checkout {{.PARENT_BRANCH}} - git weld - release: diff --git a/src/routes/page.test.js b/src/routes/page.test.js new file mode 100644 index 0000000..895c08d --- /dev/null +++ b/src/routes/page.test.js @@ -0,0 +1,9 @@ +import { render, fireEvent, screen, getByText } from "@testing-library/svelte"; +import "@testing-library/jest-dom"; + +import Page from "./+page.svelte"; + +test("we have a page", () => { + const { getByText } = render(Page); + expect(getByText("propulsion")).toBeInTheDocument(); +}); From 2b02fc15060debe98db0ed24d21cce9ffe4c6e6f Mon Sep 17 00:00:00 2001 From: Yanick Champoux Date: Fri, 14 Apr 2023 15:09:51 -0400 Subject: [PATCH 3/3] don't assume the api will be there --- src/lib/components/ShipEdit/Structure/Armor.svelte | 2 +- src/lib/components/ShipEdit/Structure/Hull.svelte | 2 +- src/lib/components/ShipEdit/Structure/Screens.svelte | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/components/ShipEdit/Structure/Armor.svelte b/src/lib/components/ShipEdit/Structure/Armor.svelte index c63e79c..31744f3 100644 --- a/src/lib/components/ShipEdit/Structure/Armor.svelte +++ b/src/lib/components/ShipEdit/Structure/Armor.svelte @@ -27,7 +27,7 @@ const api = getContext("api"); - $: api.dispatch.setNbrArmorLayers(nbr_layers); + $: api?.dispatch.setNbrArmorLayers(nbr_layers);