Skip to content

Commit

Permalink
test: Fixed duplicate test names and added eslint rules to detect dup… (
Browse files Browse the repository at this point in the history
#448)

* test: Fixed duplicate test names and added eslint rules to detect duplicates.

* test: fixed package-lock.json.

* test: reset package-lock file format to version 1.

* test: added more descriptive test names to previous duplicates.
  • Loading branch information
rc-davis authored May 31, 2022
1 parent 25a4bca commit 916a371
Show file tree
Hide file tree
Showing 9 changed files with 107 additions and 96 deletions.
10 changes: 6 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
"browser": true,
"commonjs": true,
"es2021": true,
"jest": true
"jest": true,
"jest/globals": true
},
"extends": [
"airbnb-base",
"prettier",
"plugin:import/typescript"
],
"plugins": ["only-warn", "import"],
"plugins": ["only-warn", "import", "jest"],
"parserOptions": {
"ecmaVersion": 12
},
Expand Down Expand Up @@ -65,15 +66,16 @@
}
]
}
]
],
"jest/no-identical-title": "error"
},
"overrides": [
{
"files": ["*.ts", "*.tsx"],
"parser": "@typescript-eslint/parser",
"extends": ["plugin:@typescript-eslint/recommended"]
}
],
],
"settings": {
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"]
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ node_modules/
.vscode/
build/
*.pem
.env*
.env*
.idea/
8 changes: 4 additions & 4 deletions newroutes/authenticatedSites/__tests__/Collections.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ describe("Collections Router", () => {
})
})

it("accepts valid collection create requests with specified files and returns the details of the collection created", async () => {
it("accepts valid subcollection create requests with specified files and returns the details of the collection created", async () => {
const collectionDetails = {
newDirectoryName: subcollectionName,
items: [
Expand Down Expand Up @@ -432,14 +432,14 @@ describe("Collections Router", () => {
type: "file",
},
]
it("rejects move requests with invalid body", async () => {
it("rejects move requests with empty body", async () => {
await request(app)
.post(`/${siteName}/collections/${collectionName}/move`)
.send({})
.expect(400)
})

it("rejects move requests with invalid body", async () => {
it("rejects move requests for items with invalid type", async () => {
await request(app)
.post(`/${siteName}/collections/${collectionName}/move`)
.send({
Expand All @@ -449,7 +449,7 @@ describe("Collections Router", () => {
.expect(400)
})

it("rejects move requests with invalid body", async () => {
it("rejects move requests with with no specified target", async () => {
await request(app)
.post(`/${siteName}/collections/${collectionName}/move`)
.send({ items })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ describe("Media Categories Router", () => {
.expect(400)
})

it("rejects move requests with invalid body", async () => {
it("rejects move requests for items with invalid type", async () => {
await request(app)
.post(`/${siteName}/media/${directoryName}/move`)
.send({
Expand All @@ -213,7 +213,7 @@ describe("Media Categories Router", () => {
.expect(400)
})

it("rejects move requests with invalid body", async () => {
it("rejects move requests with no specified target", async () => {
await request(app)
.post(`/${siteName}/media/${directoryName}/move`)
.send({ target: {}, items })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ describe("Resource Categories Router", () => {
.expect(400)
})

it("rejects move requests with invalid body", async () => {
it("rejects move requests for items with invalid type", async () => {
await request(app)
.post(
`/${siteName}/resourceRoom/${resourceRoomName}/resources/${resourceCategoryName}/move`
Expand All @@ -204,7 +204,7 @@ describe("Resource Categories Router", () => {
.expect(400)
})

it("rejects move requests with invalid body", async () => {
it("rejects move requests with with no specified target", async () => {
await request(app)
.post(
`/${siteName}/resourceRoom/${resourceRoomName}/resources/${resourceCategoryName}/move`
Expand Down
4 changes: 2 additions & 2 deletions newroutes/authenticatedSites/__tests__/UnlinkedPages.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ describe("Unlinked Pages Router", () => {
await request(app).post(`/${siteName}/pages/move`).send({}).expect(400)
})

it("rejects move requests with invalid body", async () => {
it("rejects move requests for items with invalid type", async () => {
await request(app)
.post(`/${siteName}/pages/move`)
.send({
Expand All @@ -272,7 +272,7 @@ describe("Unlinked Pages Router", () => {
.expect(400)
})

it("rejects move requests with invalid body", async () => {
it("rejects move requests with no specified target", async () => {
await request(app)
.post(`/${siteName}/pages/move`)
.send({ items })
Expand Down
Loading

0 comments on commit 916a371

Please sign in to comment.