mirror of
https://github.com/nowcommunity/nowdatabase.git
synced 2026-10-12 19:13:52 +03:00
lint fixes
This commit is contained in:
@@ -10,7 +10,7 @@ describe('Creating an user', () => {
|
||||
await pool.end()
|
||||
})
|
||||
|
||||
it.todo("is successful with correct data")
|
||||
it.todo("is not successfull with missing data")
|
||||
it.todo("is not successfull with incorrect password")
|
||||
it.todo('is successful with correct data')
|
||||
it.todo('is not successfull with missing data')
|
||||
it.todo('is not successfull with incorrect password')
|
||||
})
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
export const testSu = {
|
||||
username: "testSu",
|
||||
password: "test"
|
||||
username: 'testSu',
|
||||
password: 'test',
|
||||
}
|
||||
|
||||
export const newUser = {
|
||||
username: "charliechaplin123",
|
||||
password: "mutefilms",
|
||||
initials: "CC",
|
||||
role: "su",
|
||||
secret: "abcdefg"
|
||||
username: 'charliechaplin123',
|
||||
password: 'mutefilms',
|
||||
initials: 'CC',
|
||||
role: 'su',
|
||||
secret: 'abcdefg',
|
||||
}
|
||||
|
||||
export default {
|
||||
testSu,
|
||||
newUser
|
||||
newUser,
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { beforeAll, afterAll, describe, it, expect } from '@jest/globals'
|
||||
import { resetDatabase, send, resetDatabaseTimeout } from '../utils'
|
||||
import { pool } from '../../utils/db'
|
||||
import { testSu } from "./data"
|
||||
import { testSu } from './data'
|
||||
|
||||
describe('Logging in', () => {
|
||||
beforeAll(async () => {
|
||||
@@ -11,29 +11,29 @@ describe('Logging in', () => {
|
||||
await pool.end()
|
||||
})
|
||||
|
||||
it("is successful with test admin user", async () => {
|
||||
const result = await send("user/login", "POST", testSu)
|
||||
it('is successful with test admin user', async () => {
|
||||
const result = await send('user/login', 'POST', testSu)
|
||||
|
||||
expect(result.status).toEqual(200)
|
||||
expect(result.body.username).toEqual("testSu")
|
||||
expect(result.body.username).toEqual('testSu')
|
||||
expect(result.body.role).toEqual(1) // frontend/src/types: Role enum
|
||||
expect(result.body.isFirstLogin).toEqual(undefined)
|
||||
})
|
||||
|
||||
it("is not successfull with missing data", async () => {
|
||||
const resultNoUsername = await send("user/login", "POST", { password: "test" })
|
||||
const resultNoPassword = await send("user/login", "POST", { username: "testSu" })
|
||||
it('is not successfull with missing data', async () => {
|
||||
const resultNoUsername = await send('user/login', 'POST', { password: 'test' })
|
||||
const resultNoPassword = await send('user/login', 'POST', { username: 'testSu' })
|
||||
expect(resultNoUsername.status).toEqual(403)
|
||||
expect(resultNoPassword.status).toEqual(403)
|
||||
|
||||
const resultEmptyUsername = await send("user/login", "POST", { username: "", password: "test" })
|
||||
const resultEmptyPassword = await send("user/login", "POST", { username: "testSu", password: "" })
|
||||
const resultEmptyUsername = await send('user/login', 'POST', { username: '', password: 'test' })
|
||||
const resultEmptyPassword = await send('user/login', 'POST', { username: 'testSu', password: '' })
|
||||
expect(resultEmptyUsername.status).toEqual(403)
|
||||
expect(resultEmptyPassword.status).toEqual(403)
|
||||
})
|
||||
|
||||
it("is not successfull with incorrect password", async () => {
|
||||
const result = await send("user/login", "POST", { username: "testSu", password: "Test"})
|
||||
it('is not successfull with incorrect password', async () => {
|
||||
const result = await send('user/login', 'POST', { username: 'testSu', password: 'Test' })
|
||||
expect(result.status).toEqual(403)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user