From 00af90902e5921f77831c35045923a12f257c238 Mon Sep 17 00:00:00 2001 From: arpanetus Date: Tue, 2 Aug 2022 01:11:11 +0600 Subject: [PATCH] CEC-758 Add SMS send page and result (#173) * Add SMS send and result pages * Update snapshot Co-authored-by: jwu-fisker --- src/components/App/App.test.js | 9 + .../App/__snapshots__/App.test.js.snap | 982 ++++++++++++++++-- src/components/Certificates/Add/index.jsx | 2 +- src/components/Contexts/SMSContext.jsx | 63 ++ src/components/Layouts/SideMenu.jsx | 6 + .../__snapshots__/SideMenu.test.jsx.snap | 22 + src/components/Routes/SiteRoutes.jsx | 9 + src/components/SMS/Send/SendForm.jsx | 92 ++ src/components/SMS/Send/ViewResult.jsx | 39 + src/components/SMS/Send/ViewResult.test.jsx | 21 + .../__snapshots__/ViewResult.test.jsx.snap | 39 + src/components/SMS/Send/index.jsx | 68 ++ src/services/smsAPI.js | 27 + 13 files changed, 1307 insertions(+), 72 deletions(-) create mode 100644 src/components/Contexts/SMSContext.jsx create mode 100644 src/components/SMS/Send/SendForm.jsx create mode 100644 src/components/SMS/Send/ViewResult.jsx create mode 100644 src/components/SMS/Send/ViewResult.test.jsx create mode 100644 src/components/SMS/Send/__snapshots__/ViewResult.test.jsx.snap create mode 100644 src/components/SMS/Send/index.jsx create mode 100644 src/services/smsAPI.js diff --git a/src/components/App/App.test.js b/src/components/App/App.test.js index b78ce25..e92f442 100644 --- a/src/components/App/App.test.js +++ b/src/components/App/App.test.js @@ -132,6 +132,10 @@ describe("App", () => { await check("/tools/certificates/add", "span.MuiButton-label", "Sign In"); }); + it("Route /tools/sms/send unauthenticated", async () => { + await check("/tools/sms/send", "span.MuiButton-label", "Sign In"); + }) + it("Route /page-not-found unauthenticated", async () => { await check("/page-not-found", "h1", "Page Not Found"); }); @@ -189,4 +193,9 @@ describe("App", () => { setToken(TEST_AUTH_OBJECT); await check("/tools/certificates/add", "h6", "Create Certificate"); }); + + it("Route /tools/sms/send authenticated", async () => { + setToken(TEST_AUTH_OBJECT); + await check("/tools/sms/send", "h6", "Send SMS"); + }); }); diff --git a/src/components/App/__snapshots__/App.test.js.snap b/src/components/App/__snapshots__/App.test.js.snap index e5d83d8..ebc871d 100644 --- a/src/components/App/__snapshots__/App.test.js.snap +++ b/src/components/App/__snapshots__/App.test.js.snap @@ -310,6 +310,28 @@ exports[`App Route / authenticated 1`] = ` /> +
  • + +
    + + SMS + +
    + +
    +
  • @@ -808,6 +830,28 @@ exports[`App Route /home authenticated 1`] = ` /> +
  • + +
    + + SMS + +
    + +
    +
  • @@ -1342,6 +1386,28 @@ exports[`App Route /package-create authenticated 1`] = ` /> +
  • + +
    + + SMS + +
    + +
    +
  • @@ -1399,10 +1465,10 @@ exports[`App Route /package-create authenticated 1`] = ` />