From 30754acc36eaef057418459b4b0b415b1444a221 Mon Sep 17 00:00:00 2001
From: Xiao Gui <xgui3783@gmail.com>
Date: Mon, 18 Sep 2023 17:36:35 +0200
Subject: [PATCH] fix: fe/be tests, lint

---
 .github/workflows/ci.yml                      | 4 ++--
 backend/pytest.ini                            | 2 +-
 src/atlasComponents/sapi/sapi.service.spec.ts | 9 ++++-----
 src/atlasComponents/sapi/sapi.service.ts      | 2 +-
 4 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 80b4dfbfc..30f7c157b 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -65,8 +65,8 @@ jobs:
         python-version: '3.10'
     - run: |
         cd backend
+        echo "hello world" >> index.html
+        export PATH_TO_PUBLIC=$(pwd)
         pip install -r requirements.txt
         pip install pytest
         pytest
-
-  
diff --git a/backend/pytest.ini b/backend/pytest.ini
index 0d140f30b..bf8e4ff58 100644
--- a/backend/pytest.ini
+++ b/backend/pytest.ini
@@ -1,4 +1,4 @@
 [pytest]
 pythonpath = .
 testpaths = 
-    test_app
\ No newline at end of file
+    test_app
diff --git a/src/atlasComponents/sapi/sapi.service.spec.ts b/src/atlasComponents/sapi/sapi.service.spec.ts
index 723240689..ba9a8bfca 100644
--- a/src/atlasComponents/sapi/sapi.service.spec.ts
+++ b/src/atlasComponents/sapi/sapi.service.spec.ts
@@ -53,12 +53,11 @@ describe("> sapi.service.ts", () => {
           })
         })
         it("> should call fetch twice", async () => {
-          expect(fetchSpy).toHaveBeenCalledTimes(2)
+          expect(fetchSpy).toHaveBeenCalledTimes(1)
           
           const allArgs = fetchSpy.calls.allArgs()
-          expect(allArgs.length).toEqual(2)
+          expect(allArgs.length).toEqual(1)
           expect(atlasEndpts).toContain(allArgs[0][0])
-          expect(atlasEndpts).toContain(allArgs[1][0])
         })
 
         it("> endpoint should be set", async () => {
@@ -67,11 +66,11 @@ describe("> sapi.service.ts", () => {
 
         it("> additional calls should return cached observable", () => {
 
-          expect(fetchSpy).toHaveBeenCalledTimes(2)
+          expect(fetchSpy).toHaveBeenCalledTimes(1)
           SAPI.BsEndpoint$.subscribe()
           SAPI.BsEndpoint$.subscribe()
 
-          expect(fetchSpy).toHaveBeenCalledTimes(2)
+          expect(fetchSpy).toHaveBeenCalledTimes(1)
         })
       })
 
diff --git a/src/atlasComponents/sapi/sapi.service.ts b/src/atlasComponents/sapi/sapi.service.ts
index 932b6bcb4..c3543e08c 100644
--- a/src/atlasComponents/sapi/sapi.service.ts
+++ b/src/atlasComponents/sapi/sapi.service.ts
@@ -11,7 +11,7 @@ import {
   translateV3Entities
 } from "./translateV3"
 import { FeatureType, PathReturn, RouteParam, SapiRoute } from "./typeV3";
-import { BoundingBox, SxplrAtlas, SxplrParcellation, SxplrRegion, SxplrTemplate, VoiFeature, Feature } from "./sxplrTypes";
+import { BoundingBox, SxplrAtlas, SxplrParcellation, SxplrRegion, SxplrTemplate, VoiFeature } from "./sxplrTypes";
 import { parcBanList, speciesOrder } from "src/util/constants";
 import { CONST } from "common/constants"
 
-- 
GitLab