diff --git a/.env.template b/.env.template index 86292db..e3ba686 100644 --- a/.env.template +++ b/.env.template @@ -1,3 +1,3 @@ -REACT_APP_AUTH_SERVICE_URL = https://dev-auth.fiskerdps.com -REACT_APP_UPLOAD_SERVICE_URL = https://gw-dev.fiskerdps.com -REACT_APP_AUTH_CALLBACK_URL = https://dev-ota-admin.fiskerdps.com/ \ No newline at end of file +REACT_APP_AUTH_SERVICE_URL = http://localhost/compute_auth +REACT_APP_UPLOAD_SERVICE_URL = http://localhost/ota_update +REACT_APP_AUTH_CALLBACK_URL = http://localhost:3000 \ No newline at end of file diff --git a/README.md b/README.md index b97dc56..f9c3bd2 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,23 @@ # Fisker Admin Portal -Front-end web application for administarting OTA services +Front-end web application for administrating services # Setup -Run `./run.sh` from the terminal or +Running locally 1. Install Node 12 2. Run `npm install` -3. Setup environment variables listed in .env.template -4. Or copy .env.template to .env -5. Edit .env with the service urls for authentication and api services +3. Copy .env.template to .env and edit the service urls for authentication and api services +4. Run `./run.sh` from the terminal +5. Access portal at localhost:3000 + +Running Docker container + +1. Copy .env.template to .env and edit the service urls for authentication and api services +2. Build the image `docker build -t fiskerinc/portal .` +3. Start the container `docker run -p 3000:80 fiskerinc/portal` +4. Access portal at localhost:3000 ## Available Scripts diff --git a/src/components/App/App.test.js b/src/components/App/App.test.js index 7e442ed..f819255 100644 --- a/src/components/App/App.test.js +++ b/src/components/App/App.test.js @@ -59,12 +59,6 @@ describe("App", () => { await check("/package-upload", "span.MuiButton-label", "Sign In"); }); - it("Route /package-upload unauthenticated", async () => { - const container = await renderRoute("/package-upload"); - expect(container.querySelector("span.MuiButton-label").innerHTML).toEqual("Sign In"); - expect(container).toMatchSnapshot(); - }); - it("Route /vehicle-add unauthenticated", async () => { await check("/vehicle-add", "span.MuiButton-label", "Sign In"); }); @@ -105,7 +99,7 @@ describe("App", () => { it("Route /package-upload authenticated", async () => { setToken(TEST_AUTH_OBJECT); - await check("/package-upload", "h1", "Upload Update Package"); + await check("/package-upload", "h1", "Create Update Package"); }); it("Route /vehicle-add authenticated", async () => { @@ -115,17 +109,17 @@ describe("App", () => { it("Route /updates authenticated", async () => { setToken(TEST_AUTH_OBJECT); - await check("/updates", "h1", "Updates"); + await check("/updates", "h1", "Update Packages"); }); it("Route /update authenticated", async () => { setToken(TEST_AUTH_OBJECT); - await check("/update/1", "h1", "Update Package 1"); + await check("/update/1", "h1", "Edit Update Package 1"); }); it("Route /carupdate-deploy authenticated", async () => { setToken(TEST_AUTH_OBJECT); - await check("/carupdate-deploy/1", "h1", "[1] "); + await check("/carupdate-deploy/1", "h1", "Deploy [1]"); }); it("Route /carupdate-status authenticated", async () => { diff --git a/src/components/App/__snapshots__/App.test.js.snap b/src/components/App/__snapshots__/App.test.js.snap index 9201060..e01a2c4 100644 --- a/src/components/App/__snapshots__/App.test.js.snap +++ b/src/components/App/__snapshots__/App.test.js.snap @@ -6,17 +6,17 @@ exports[`App Route / authenticated 1`] = ` data-testid="mocked-userprovider" >
- Create Updates + Create Packages

+
+
+
+
+ +
+ Fisker OTA Portal +
+ +
+
+ +
+
+
+
+
+
+

+ Deploy + [1] +

+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+