From abc8b02a9c73e68f435d8971b2ef0e1970f42212 Mon Sep 17 00:00:00 2001
From: Catalin Mititiuc
Date: Tue, 28 May 2024 15:42:04 -0700
Subject: WIP: select counter test
---
src/modules/gameboard.js | 3 +-
src/modules/record_sheet.js | 2 +-
src/scenario-side_show.svg | 1973 ---------------------------
test/integration/fixtures/scenario-test.svg | 24 +-
test/integration/page.test.js | 99 +-
5 files changed, 38 insertions(+), 2063 deletions(-)
delete mode 100644 src/scenario-side_show.svg
diff --git a/src/modules/gameboard.js b/src/modules/gameboard.js
index a354795..38a9a9a 100644
--- a/src/modules/gameboard.js
+++ b/src/modules/gameboard.js
@@ -200,7 +200,8 @@ function endMove() {
export function start(el) {
svg = el;
- getUnits(svg).forEach(unit => unit.addEventListener('click', selectOffBoard));
+ const startingLocations = svg.querySelector('.start-locations');
+ startingLocations && getUnits(startingLocations).forEach(unit => unit.addEventListener('click', selectOffBoard));
getCells(svg).forEach(cell => {
cell.addEventListener('click', e => {
diff --git a/src/modules/record_sheet.js b/src/modules/record_sheet.js
index 61cea98..2865309 100644
--- a/src/modules/record_sheet.js
+++ b/src/modules/record_sheet.js
@@ -179,7 +179,7 @@ export function start(startLoc, units) {
for (const affiliation in forces) {
const container = document.querySelector(`#${affiliation}-record`);
const records = container.querySelector('.records');
- const name = startLoc.dataset[`${affiliation}Name`];
+ const name = startLoc?.dataset[`${affiliation}Name`];
if (name) {
container.querySelector('.name').textContent = name;
diff --git a/src/scenario-side_show.svg b/src/scenario-side_show.svg
deleted file mode 100644
index e4211a0..0000000
--- a/src/scenario-side_show.svg
+++ /dev/null
@@ -1,1973 +0,0 @@
-
-
diff --git a/test/integration/fixtures/scenario-test.svg b/test/integration/fixtures/scenario-test.svg
index 0e12afb..d4d8453 100644
--- a/test/integration/fixtures/scenario-test.svg
+++ b/test/integration/fixtures/scenario-test.svg
@@ -1,6 +1,6 @@