Skip to content

Commit

Permalink
Fixes lint and test issues
Browse files Browse the repository at this point in the history
Crystal Ngai committed Mar 9, 2021
1 parent 872100c commit f528755
Showing 10 changed files with 34 additions and 23 deletions.
3 changes: 0 additions & 3 deletions .ebignore

This file was deleted.

16 changes: 8 additions & 8 deletions .github/workflows/build-qa.yml
Original file line number Diff line number Diff line change
@@ -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
aws ecs update-service --cluster sfr-front-end-qa --service sfr-front-end-qa --force-new-deployment
File renamed without changes.
5 changes: 5 additions & 0 deletions src/components/About/__snapshots__/About.test.tsx.snap
Original file line number Diff line number Diff line change
@@ -19,6 +19,11 @@ exports[`renders About page correctly 1`] = `
},
]
}
modifiers={
Array [
"space-under",
]
}
/>
</div>
<div
14 changes: 7 additions & 7 deletions src/components/EditionCard/EditionCard.test.tsx
Original file line number Diff line number Diff line change
@@ -60,9 +60,9 @@ describe("Edition Card with Valid Data", () => {
render(<EditionCard edition={fullEdition}></EditionCard>);
});
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(<EditionCard edition={{ id: 54321 }}></EditionCard>);
});
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(
6 changes: 5 additions & 1 deletion src/components/EditionDetail/Edition.test.tsx
Original file line number Diff line number Diff line change
@@ -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", () => {
5 changes: 5 additions & 0 deletions src/components/License/__snapshots__/License.test.tsx.snap
Original file line number Diff line number Diff line change
@@ -20,6 +20,11 @@ exports[`renders License page correctly 1`] = `
},
]
}
modifiers={
Array [
"space-under",
]
}
/>
</div>
<div
2 changes: 1 addition & 1 deletion src/components/Search/Search.test.tsx
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ describe("Search Query Queries correctly prepopulate content", () => {
).toBeInTheDocument();
});

test.only("Search with multiple queries", () => {
test("Search with multiple queries", () => {
const multipleQuerySearch = Object.assign({}, searchQuery, {
queries: [
{ field: "keyword", query: "happy" },
4 changes: 2 additions & 2 deletions src/components/Work/Work.test.tsx
Original file line number Diff line number Diff line change
@@ -59,15 +59,15 @@ 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) => {
expect(
(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"
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -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"]
}

0 comments on commit f528755

Please sign in to comment.