Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Fixed duplicate test names and added eslint rules to detect dup… #448

Merged
merged 4 commits into from
May 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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