diff --git a/.ebignore b/.ebignore deleted file mode 100644 index 3dbebfca..00000000 --- a/.ebignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules/ -.git/ -npm-debug.log* diff --git a/.github/workflows/build-qa.yml b/.github/workflows/build-qa.yml index 196d697f..780e8357 100644 --- a/.github/workflows/build-qa.yml +++ b/.github/workflows/build-qa.yml @@ -1,27 +1,27 @@ -# On merge to development, +# On merge to development, # build a container and deploy to ECR name: Publish qa on: pull_request: - branches: [fc-components] + branches: [development] types: [closed] -jobs: - publish_qa: +jobs: + publish_qa: name: Publish image to ECR if: github.event.pull_request.merged runs-on: ubuntu-latest - steps: + steps: - name: checkout uses: actions/checkout@v2 - id: nvmrc run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc) - + - name: Set up node with version from nvm uses: actions/setup-node@v2 with: { node-version: "${{ steps.nvmrc.outputs.NODE_VERSION }}" } - + - name: Configure AWS credentials from Test account uses: aws-actions/configure-aws-credentials@v1 with: @@ -46,4 +46,4 @@ jobs: - name: Force ECS Update run: | - aws ecs update-service --cluster sfr-front-end-qa --service sfr-front-end-qa --force-new-deployment \ No newline at end of file + aws ecs update-service --cluster sfr-front-end-qa --service sfr-front-end-qa --force-new-deployment diff --git a/src/__tests__/index.test.tsx b/src/__tests__/index.test.jsx similarity index 100% rename from src/__tests__/index.test.tsx rename to src/__tests__/index.test.jsx diff --git a/src/components/About/__snapshots__/About.test.tsx.snap b/src/components/About/__snapshots__/About.test.tsx.snap index 99a2bec9..e22c7ca1 100644 --- a/src/components/About/__snapshots__/About.test.tsx.snap +++ b/src/components/About/__snapshots__/About.test.tsx.snap @@ -19,6 +19,11 @@ exports[`renders About page correctly 1`] = ` }, ] } + modifiers={ + Array [ + "space-under", + ] + } />
{ render(); }); test("Shows Year as Link in header", () => { - expect( - screen.getByRole("heading", { name: "1990 Edition" }).closest("a").href - ).toContain("/edition/12345"); + expect(screen.getByText("1990 Edition").closest("a").href).toContain( + "/edition/12345" + ); }); test("Shows Full Publisher", () => { expect( @@ -100,14 +100,14 @@ describe("Edition Card with Valid Data", () => { }); }); -describe.only("Edition Year with Minimal Data", () => { +describe("Edition Year with Minimal Data", () => { beforeEach(() => { render(); }); test("Shows Unknown Year as Link in header", () => { - expect(screen.getByText("Edtion Year Unknown").closest("a")).toContain( - "/edition/54321" - ); + expect( + screen.getByText("Edition Year Unknown").closest("a").href + ).toContain("/edition/54321"); }); test("Shows Unknown Publisher", () => { expect( diff --git a/src/components/EditionDetail/Edition.test.tsx b/src/components/EditionDetail/Edition.test.tsx index 474beb68..174acbcb 100644 --- a/src/components/EditionDetail/Edition.test.tsx +++ b/src/components/EditionDetail/Edition.test.tsx @@ -65,7 +65,11 @@ describe("Renders edition component when given valid edition", () => { ).length ).toBe(2); expect( - screen.getAllByText("License: Unknown")[0].closest("a").href + screen + .getAllByText( + "License: Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International" + )[0] + .closest("a").href ).toContain("/license"); }); test("Shows Details Table", () => { diff --git a/src/components/License/__snapshots__/License.test.tsx.snap b/src/components/License/__snapshots__/License.test.tsx.snap index 8121febe..569f91bc 100644 --- a/src/components/License/__snapshots__/License.test.tsx.snap +++ b/src/components/License/__snapshots__/License.test.tsx.snap @@ -20,6 +20,11 @@ exports[`renders License page correctly 1`] = ` }, ] } + modifiers={ + Array [ + "space-under", + ] + } />
{ ).toBeInTheDocument(); }); - test.only("Search with multiple queries", () => { + test("Search with multiple queries", () => { const multipleQuerySearch = Object.assign({}, searchQuery, { queries: [ { field: "keyword", query: "happy" }, diff --git a/src/components/Work/Work.test.tsx b/src/components/Work/Work.test.tsx index d60974d5..b75b6d9a 100644 --- a/src/components/Work/Work.test.tsx +++ b/src/components/Work/Work.test.tsx @@ -59,7 +59,7 @@ describe("Renders Work component when given valid work", () => { screen.getByRole("heading", { name: "Featured Edition" }) ).toBeInTheDocument(); const featuredEditionHeadings = screen.getAllByRole("heading", { - name: "1854 Edition", + name: "1853 Edition", }); expect(featuredEditionHeadings.length).toEqual(2); featuredEditionHeadings.forEach((heading) => { @@ -67,7 +67,7 @@ describe("Renders Work component when given valid work", () => { (within(heading).getByRole("link") as HTMLLinkElement).href ).toContain("/edition"); }); - expect(screen.getAllByAltText("Cover for 1854 Edition").length).toBe(2); + expect(screen.getAllByAltText("Cover for 1853 Edition").length).toBe(2); expect( screen.getAllByText( "Published in London by Chapman & Hall British publishing house + 4 more" diff --git a/tsconfig.json b/tsconfig.json index 63491b94..6aceb9c4 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -25,6 +25,6 @@ "**/*.ts", "**/*.tsx", "next.config.js" -, "src/components/Citations/APACitation.jsx", "src/components/Citations/formatCitation.jsx", "src/components/RequestDigital/RequestDigital.jsx" ], +, "src/components/Citations/APACitation.jsx", "src/components/Citations/formatCitation.jsx", "src/components/RequestDigital/RequestDigital.jsx", "src/__tests__/index.test.jsx" ], "exclude": ["node_modules", "jest.config.js", "setupTests.js"] }