Skip to content
Snippets Groups Projects
Commit 4c39d063 authored by Embruch, Gerd's avatar Embruch, Gerd
Browse files

added test for new user routes

parent 2ca51dda
No related branches found
No related tags found
No related merge requests found
Showing
with 2097 additions and 605 deletions
......@@ -9,7 +9,7 @@ exports[`refresh JWT > given authtoken is valid > should respond with a proper b
exports[`refresh JWT > given refresh token is invalid > should respond with a proper body 1`] = `
{
"message": "Refresh token is invalid",
"message": "Refresh token is invalid. Please Re-Login.",
}
`;
......
......@@ -97,7 +97,7 @@ describe('refresh JWT', () => {
.set('Cookie', 'refreshToken=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY2YTNkYTViYTEwNjUzMmNhZTEyYTYwOSIsImlhdCI6MTcyMjA5ODM3OX0.7Pq8F2zSDwuEzlCQX3vMZAw9D43N6dSViCyVPZ_s_Zs');
});
it('should return a proper status code', () => {
expect(response.status).toBe(403);
expect(response.status).toBe(498);
});
it('should respond with a proper body', () => {
expect(response.body).toMatchSnapshot();
......
......@@ -109,7 +109,7 @@ Authorization: Bearer {{token}}
### DELETE
DELETE {{host}}/users/{{userId}}
DELETE {{host}}/users/66b77c29108488f6000e73cb
content-type: application/json
Authorization: Bearer {{token}}
......
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`delete user > given a user tries to access > should respond with a proper body 1`] = `
{
"document": {
"acknowledged": true,
"deletedCount": 1,
},
"message": "User successfully deleted",
}
`;
exports[`delete user > given another user tries to access > should respond with a proper body 1`] = `
{
"message": "Access forbidden",
}
`;
exports[`delete user > given no jwt sended > should respond with a proper body 1`] = `
{
"message": "No access token found. Access denied.",
}
`;
exports[`delete user > given no matching user found > should respond with a proper body 1`] = `
{
"document": {
"acknowledged": true,
"deletedCount": 0,
},
"message": "User successfully deleted",
}
`;
exports[`delete user > given no valid jwt sended > should respond with a proper body 1`] = `
{
"message": "Access token is no longer valid. Access denied.",
}
`;
exports[`delete user > given the inputs are valid > should respond with a proper body 1`] = `
{
"document": {
"acknowledged": true,
"deletedCount": 1,
},
"message": "User successfully deleted",
}
`;
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`user find by ID > given a user tries to access > should respond with a proper body 1`] = `
{
"message": "Access Forbidden",
}
`;
exports[`user find by ID > given no jwt sended > should respond with a proper body 1`] = `
{
"message": "No access token found. Access denied.",
}
`;
exports[`user find by ID > given no valid jwt sended > should respond with a proper body 1`] = `
{
"message": "Access token is no longer valid. Access denied.",
}
`;
exports[`user find by ID > given the inputs are valid > should respond with a proper body 1`] = `
[
{
"__v": 0,
"_id": "66a29da2942b3eb",
"createdAt": "2024-07 - 25T18: 46: 58.982Z",
"email": "user@mail.local",
"fullname": "",
"id": "66a29da2942b3ebcaf047f07",
"name": "My User",
"role": 0,
"updatedAt": "2024-07 - 25T18: 46: 58.982Z",
"username": "snoopy",
"verified": true,
},
{
"__v": 0,
"_id": "66a29da2942b3eb",
"createdAt": "2024-07 - 25T18: 46: 58.982Z",
"email": "user@mail.local",
"fullname": "",
"id": "66a29da2942b3ebcaf047f07",
"name": "My User",
"role": 0,
"updatedAt": "2024-07 - 25T18: 46: 58.982Z",
"username": "snoopy",
"verified": true,
},
]
`;
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`user find by ID > given no jwt sended > should respond with a proper body 1`] = `
{
"message": "No access token found. Access denied.",
}
`;
exports[`user find by ID > given no valid jwt sended > should respond with a proper body 1`] = `
{
"message": "Access token is no longer valid. Access denied.",
}
`;
exports[`user find by ID > given the inputs are valid > should respond with a proper body 1`] = `
{
"__v": 0,
"_id": "66a29da2942b3eb",
"createdAt": "2024-07 - 25T18: 46: 58.982Z",
"email": "user@mail.local",
"fullname": "",
"id": "66a29da2942b3ebcaf047f07",
"name": "My User",
"role": 0,
"updatedAt": "2024-07 - 25T18: 46: 58.982Z",
"username": "snoopy",
"verified": true,
}
`;
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`update user > given an admin tries to access > should respond with a proper body 1`] = `
{
"document": {
"__v": 0,
"_id": "66a29da2942b3eb",
"createdAt": "2024-07 - 25T18: 46: 58.982Z",
"email": "user@mail.olcal",
"fullname": "",
"id": "66a29da2942b3ebcaf047f07",
"name": "My User",
"role": 0,
"updatedAt": "2024-07 - 25T18: 46: 58.982Z",
"username": "snoopy",
"verified": true,
},
"message": "User successfully updated",
}
`;
exports[`update user > given another user tries to access > should respond with a proper body 1`] = `
{
"message": "Access forbidden",
}
`;
exports[`update user > given no jwt sended > should respond with a proper body 1`] = `
{
"message": "No access token found. Access denied.",
}
`;
exports[`update user > given no valid jwt sended > should respond with a proper body 1`] = `
{
"message": "Access token is no longer valid. Access denied.",
}
`;
exports[`update user > given required fields are missing > should respond with a proper body 1`] = `
{
"message": "Validation errors. Please check the error messages.",
"validationErrors": {
"username": "Required",
},
}
`;
exports[`update user > given the inputs are valid > should respond with a proper body 1`] = `
{
"document": {
"__v": 0,
"_id": "66a29da2942b3eb",
"createdAt": "2024-07 - 25T18: 46: 58.982Z",
"email": "user@mail.olcal",
"fullname": "",
"id": "66a29da2942b3ebcaf047f07",
"name": "My User",
"role": 0,
"updatedAt": "2024-07 - 25T18: 46: 58.982Z",
"username": "snoopy",
"verified": true,
},
"message": "User successfully updated",
}
`;
// import vitest, supertest & app
import { vi, beforeAll, beforeEach, describe, expect, expectTypeOf, test, it, afterEach } from 'vitest';
import supertest from "supertest";
import app from "../../app.js";
import jwt from 'jsonwebtoken';
// set route
const ROUTE = '/users/66a29da2942b3ebcaf047f07';
// prepare response of each test
let response;
// ############################
// OBJECTS
// ############################
const mockedVals = vi.hoisted(() => {
return {
foundUser: {
_id: '66a29da2942b3eb',
username: 'snoopy',
name: 'My User',
email: 'user@mail.local',
verified: true,
role: 4,
createdAt: '2024-07 - 25T18: 46: 58.982Z',
updatedAt: '2024-07 - 25T18: 46: 58.982Z',
__v: 0,
fullname: '',
id: '66a29da2942b3ebcaf047f07'
},
deleteResponse: {
"acknowledged": true,
"deletedCount": 1
},
anotherUser: {
_id: '1234',
username: 'goofy',
name: 'hackerman oha',
email: 'hacker@mail.local',
verified: true,
role: 0,
createdAt: '2024-07 - 25T18: 46: 58.982Z',
updatedAt: '2024-07 - 25T18: 46: 58.982Z',
__v: 0,
fullname: '',
id: '1234'
}
};
});
// ############################
// MOCKS
// ############################
import * as dbService from '../../utils/handleDB.js';
// mock dbService
vi.mock('../../utils/handleDB.js', async (importOriginal) => {
return {
...await importOriginal(),
dbConnection: vi.fn(() => 'mocked'),
findOneRecord: vi.fn(() => mockedVals.foundUser),
deleteOneRecord: vi.fn().mockImplementation(() => mockedVals.deleteResponse)
};
});
// ############################
// TESTS
// ############################
describe('delete user', () => {
const _jwt = (id, role) => {
return jwt.sign({ id, role }, process.env.JWT_SECRET_KEY, { expiresIn: process.env.JWT_TTL });
};
describe('given the inputs are valid', async () => {
beforeAll(async () => {
response = await supertest(app)
.delete(ROUTE)
.set('Authorization', `Bearer ${_jwt(mockedVals.foundUser.id, mockedVals.foundUser.role)}`)
.send();
});
it('should return a proper status code status', () => {
expect(response.status).toBe(200);
});
it('should respond with a proper body', () => {
expect(response.body).toMatchSnapshot();
});
});
// ############################
describe('given a user tries to access', () => {
beforeAll(async () => {
response = await supertest(app)
.delete(ROUTE)
.set('Authorization', `Bearer ${_jwt(mockedVals.foundUser.id, 0)}`)
.send();
});
it('should return a proper status code status', () => {
expect(response.status).toBe(200);
});
it('should respond with a proper body', () => {
expect(response.body).toMatchSnapshot();
});
});
// ############################
describe('given no matching user found', () => {
beforeAll(async () => {
dbService.deleteOneRecord.mockImplementation(() => { return { ...mockedVals.deleteResponse, deletedCount: 0 }; });
response = await supertest(app)
.delete(ROUTE)
.set('Authorization', `Bearer ${_jwt(mockedVals.foundUser.id, mockedVals.foundUser.role)}`)
.send();
});
it('should return a proper status code status', () => {
expect(response.status).toBe(200);
});
it('should respond with a proper body', () => {
expect(response.body).toMatchSnapshot();
});
});
// ############################
describe('given another user tries to access', () => {
beforeAll(async () => {
response = await supertest(app)
.delete(ROUTE)
.set('Authorization', `Bearer ${_jwt(mockedVals.anotherUser.id, mockedVals.anotherUser.role)}`)
.send();
});
it('should return a proper status code status', () => {
expect(response.status).toBe(403);
});
it('should respond with a proper body', () => {
expect(response.body).toMatchSnapshot();
});
});
// ############################
describe('given no valid jwt sended', () => {
beforeAll(async () => {
response = await supertest(app)
.delete(ROUTE)
.set('Authorization', `Bearer invalid`)
.send();
});
it('should return a proper status code status', () => {
expect(response.status).toBe(403);
});
it('should respond with a proper body', () => {
expect(response.body).toMatchSnapshot();
});
});
// ############################
describe('given no jwt sended', () => {
beforeAll(async () => {
response = await supertest(app)
.delete(ROUTE)
.send();
});
it('should return a proper status code status', () => {
expect(response.status).toBe(401);
});
it('should respond with a proper body', () => {
expect(response.body).toMatchSnapshot();
});
});
});
\ No newline at end of file
// import vitest, supertest & app
import { vi, beforeAll, beforeEach, describe, expect, expectTypeOf, test, it, afterEach } from 'vitest';
import supertest from "supertest";
import app from "../../app.js";
import jwt from 'jsonwebtoken';
// set route
const ROUTE = '/users';
// prepare response of each test
let response;
// ############################
// OBJECTS
// ############################
const mockedVals = vi.hoisted(() => {
return {
foundUser: {
_id: '66a29da2942b3eb',
username: 'snoopy',
name: 'My User',
email: 'user@mail.local',
verified: true,
role: 4,
createdAt: '2024-07 - 25T18: 46: 58.982Z',
updatedAt: '2024-07 - 25T18: 46: 58.982Z',
__v: 0,
fullname: '',
id: '66a29da2942b3ebcaf047f07'
},
foundUsers: [{
_id: '66a29da2942b3eb',
username: 'snoopy',
name: 'My User',
email: 'user@mail.local',
verified: true,
role: 0,
createdAt: '2024-07 - 25T18: 46: 58.982Z',
updatedAt: '2024-07 - 25T18: 46: 58.982Z',
__v: 0,
fullname: '',
id: '66a29da2942b3ebcaf047f07'
}, {
_id: '66a29da2942b3eb',
username: 'snoopy',
name: 'My User',
email: 'user@mail.local',
verified: true,
role: 0,
createdAt: '2024-07 - 25T18: 46: 58.982Z',
updatedAt: '2024-07 - 25T18: 46: 58.982Z',
__v: 0,
fullname: '',
id: '66a29da2942b3ebcaf047f07'
}
]
};
});
// ############################
// MOCKS
// ############################
// import Database Service
import * as dbService from '../../utils/handleDB.js';
// mock dbService
vi.mock('../../utils/handleDB.js', async (importOriginal) => {
return {
...await importOriginal(),
dbConnection: vi.fn(() => 'mocked'),
findOneRecord: vi.fn(() => mockedVals.foundUser),
findRecordByID: vi.fn(() => mockedVals.foundUser),
findRecords: vi.fn(() => mockedVals.foundUsers)
};
});
// ############################
// TESTS
// ############################
describe('user find by ID', () => {
const _jwt = (id, role) => {
return jwt.sign({ id, role }, process.env.JWT_SECRET_KEY, { expiresIn: process.env.JWT_TTL });
};
describe('given the inputs are valid', async () => {
// set response by running route
beforeAll(async () => {
response = await supertest(app)
.get(ROUTE)
.set('Authorization', `Bearer ${_jwt(mockedVals.foundUser.id, mockedVals.foundUser.role)}`)
.send();
});
it('should return a proper status code', () => {
expect(response.status).toBe(200);
});
it('should respond with a proper body', () => {
expect(response.body).toMatchSnapshot();
});
});
// ############################
describe('given a user tries to access', () => {
beforeAll(async () => {
dbService.findOneRecord.mockImplementationOnce(async () => {
return { ...mockedVals.foundUser, role: 0 };
});
response = await supertest(app)
.get(ROUTE)
.set('Authorization', `Bearer ${_jwt(mockedVals.foundUser.id, 0)}`)
.send();
});
it('should return a proper status code status', () => {
expect(response.status).toBe(403);
});
it('should respond with a proper body', () => {
expect(response.body).toMatchSnapshot();
});
});
// ############################
describe('given no valid jwt sended', () => {
beforeAll(async () => {
response = await supertest(app)
.get(ROUTE)
.set('Authorization', `Bearer invalid`)
.send();
});
it('should return a proper status code status', () => {
expect(response.status).toBe(403);
});
it('should respond with a proper body', () => {
expect(response.body).toMatchSnapshot();
});
});
// ############################
describe('given no jwt sended', () => {
beforeAll(async () => {
response = await supertest(app)
.get(ROUTE)
.send();
});
it('should return a proper status code status', () => {
expect(response.status).toBe(401);
});
it('should respond with a proper body', () => {
expect(response.body).toMatchSnapshot();
});
});
});
\ No newline at end of file
// import vitest, supertest & app
import { vi, beforeAll, beforeEach, describe, expect, expectTypeOf, test, it, afterEach } from 'vitest';
import supertest from "supertest";
import app from "../../app.js";
import jwt from 'jsonwebtoken';
// set route
const ROUTE = '/users/66a29da2942b3ebcaf047f07';
// prepare response of each test
let response;
// ############################
// OBJECTS
// ############################
const mockedVals = vi.hoisted(() => {
return {
foundUser: {
_id: '66a29da2942b3eb',
username: 'snoopy',
name: 'My User',
email: 'user@mail.local',
verified: true,
role: 0,
createdAt: '2024-07 - 25T18: 46: 58.982Z',
updatedAt: '2024-07 - 25T18: 46: 58.982Z',
__v: 0,
fullname: '',
id: '66a29da2942b3ebcaf047f07'
}
};
});
// ############################
// MOCKS
// ############################
// import Database Service
import * as dbService from '../../utils/handleDB.js';
// mock dbService
vi.mock('../../utils/handleDB.js', async (importOriginal) => {
return {
...await importOriginal(),
dbConnection: vi.fn(() => 'mocked'),
findOneRecord: vi.fn(() => mockedVals.foundUser),
findRecordByID: vi.fn(() => mockedVals.foundUser)
};
});
// ############################
// TESTS
// ############################
describe('user find by ID', () => {
const _jwt = (id, role) => {
return jwt.sign({ id, role }, process.env.JWT_SECRET_KEY, { expiresIn: process.env.JWT_TTL });
};
describe('given the inputs are valid', async () => {
// set response by running route
beforeAll(async () => {
response = await supertest(app)
.get(ROUTE)
.set('Authorization', `Bearer ${_jwt(mockedVals.foundUser.id, mockedVals.foundUser.role)}`)
.send();
});
it('should return a proper status code', () => {
expect(response.status).toBe(200);
});
it('should respond with a proper body', () => {
expect(response.body).toMatchSnapshot();
});
});
// ############################
describe('given no valid jwt sended', () => {
beforeAll(async () => {
response = await supertest(app)
.get(ROUTE)
.set('Authorization', `Bearer invalid`)
.send();
});
it('should return a proper status code status', () => {
expect(response.status).toBe(403);
});
it('should respond with a proper body', () => {
expect(response.body).toMatchSnapshot();
});
});
// ############################
describe('given no jwt sended', () => {
beforeAll(async () => {
response = await supertest(app)
.get(ROUTE)
.send();
});
it('should return a proper status code status', () => {
expect(response.status).toBe(401);
});
it('should respond with a proper body', () => {
expect(response.body).toMatchSnapshot();
});
});
});
\ No newline at end of file
// import vitest, supertest & app
import { vi, beforeAll, beforeEach, describe, expect, expectTypeOf, test, it, afterEach } from 'vitest';
import supertest from "supertest";
import app from "../../app.js";
import jwt from 'jsonwebtoken';
// set route
const ROUTE = '/users/66a29da2942b3ebcaf047f07';
// prepare response of each test
let response;
// ############################
// OBJECTS
// ############################
const mockedVals = vi.hoisted(() => {
return {
foundUser: {
_id: '66a29da2942b3eb',
username: 'snoopy',
name: 'My User',
email: 'user@mail.local',
verified: true,
role: 0,
createdAt: '2024-07 - 25T18: 46: 58.982Z',
updatedAt: '2024-07 - 25T18: 46: 58.982Z',
__v: 0,
fullname: '',
id: '66a29da2942b3ebcaf047f07'
}, validInput: {
name: "My User",
username: "snoopy",
email: "user@mail.olcal",
verified: true,
role: 0
},
anotherUser: {
_id: '1234',
username: 'goofy',
name: 'hackerman oha',
email: 'hacker@mail.local',
verified: true,
role: 0,
createdAt: '2024-07 - 25T18: 46: 58.982Z',
updatedAt: '2024-07 - 25T18: 46: 58.982Z',
__v: 0,
fullname: '',
id: '1234'
}
};
});
// ############################
// MOCKS
// ############################
// import Database Service
import * as dbService from '../../utils/handleDB.js';
// mock dbService
vi.mock('../../utils/handleDB.js', async (importOriginal) => {
return {
...await importOriginal(),
dbConnection: vi.fn(() => 'mocked'),
findOneRecord: vi.fn(() => mockedVals.foundUser),
findRecordByID: vi.fn(() => mockedVals.foundUser),
findByIdAndUpdate: vi.fn(() => mockedVals.foundUser),
};
});
// ############################
// TESTS
// ############################
describe('update user', () => {
const _jwt = (id, role) => {
return jwt.sign({ id, role }, process.env.JWT_SECRET_KEY, { expiresIn: process.env.JWT_TTL });
};
describe('given the inputs are valid', async () => {
// set response by running route
beforeAll(async () => {
response = await supertest(app)
.patch(ROUTE)
.set('Authorization', `Bearer ${_jwt(mockedVals.foundUser.id, mockedVals.foundUser.role)}`)
.send(mockedVals.validInput);
});
it('should return a proper status code', () => {
expect(response.status).toBe(200);
});
it('should respond with a proper body', () => {
expect(response.body).toMatchSnapshot();
});
});
// ############################
describe('given another user tries to access', () => {
beforeAll(async () => {
dbService.findOneRecord.mockImplementationOnce(async () => {
return anotherUser;
});
response = await supertest(app)
.patch(ROUTE)
.set('Authorization', `Bearer ${_jwt(mockedVals.anotherUser.id, mockedVals.anotherUser.role)}`)
.send(mockedVals.validInput);
});
it('should return a proper status code status', () => {
expect(response.status).toBe(403);
});
it('should respond with a proper body', () => {
expect(response.body).toMatchSnapshot();
});
});
// ############################
describe('given an admin tries to access', () => {
beforeAll(async () => {
dbService.findOneRecord.mockImplementationOnce(async () => {
return anotherUser;
});
response = await supertest(app)
.patch(ROUTE)
.set('Authorization', `Bearer ${_jwt(mockedVals.anotherUser.id, 4)}`)
.send(mockedVals.validInput);
});
it('should return a proper status code status', () => {
expect(response.status).toBe(200);
});
it('should respond with a proper body', () => {
expect(response.body).toMatchSnapshot();
});
});
// ############################
describe('given required fields are missing', () => {
beforeAll(async () => {
const { username, ...input } = mockedVals.validInput;
response = await supertest(app)
.patch(ROUTE)
.set('Authorization', `Bearer ${_jwt(mockedVals.foundUser.id, mockedVals.foundUser.role)}`)
.send(input);
});
it('should return a proper status code status', () => {
expect(response.status).toBe(400);
});
it('should respond with a proper body', () => {
expect(response.body).toMatchSnapshot();
});
});
// ############################;
describe('given no valid jwt sended', () => {
beforeAll(async () => {
response = await supertest(app)
.patch(ROUTE)
.set('Authorization', `Bearer invalid`)
.send();
});
it('should return a proper status code status', () => {
expect(response.status).toBe(403);
});
it('should respond with a proper body', () => {
expect(response.body).toMatchSnapshot();
});
});
// ############################
describe('given no jwt sended', () => {
beforeAll(async () => {
response = await supertest(app)
.patch(ROUTE)
.send();
});
it('should return a proper status code status', () => {
expect(response.status).toBe(401);
});
it('should respond with a proper body', () => {
expect(response.body).toMatchSnapshot();
});
});
});
\ No newline at end of file
......@@ -78,9 +78,6 @@ export const login = async (req, res, next) => {
// remember document but remove confidential info
const user = hideConfidentialFields(User, foundUser);
console.log("🚀 ~ login ~ user:", user);
// create jsonwebtoken
performance.mark('createAccessToken:start');
const accessToken = createAccessToken({ id: user._id, role: user.role });
......
import User from "../models/User.js";
import { createRecord, deleteOneRecord, findOneRecord, findRecordByID, findRecords } from "../utils/handleDB.js";
import { createRecord, deleteOneRecord, findByIdAndUpdate, findOneRecord, findRecordByID, findRecords } from "../utils/handleDB.js";
import { prefillDocumentObject, hideConfidentialFields } from '../utils/handleSchemes.js';
/** *******************************************************
......@@ -53,7 +53,6 @@ export const getUsers = async (req, res, next) => {
* UPDATE ONE
*/
export const updateUser = async (req, res, next) => {
// check if user is allowed to change data
// if not self editing
if (global.currentUserId !== req.requestedDocument.id) {
......@@ -69,7 +68,8 @@ export const updateUser = async (req, res, next) => {
Object.assign(req.requestedDocument, newData);
// try saving
try {
const updatedUser = await req.requestedDocument.save({ new: true });
// const updatedUser = await req.requestedDocument.save({ new: true });
const updatedUser = await findByIdAndUpdate(User, req.requestedDocument.id, req.requestedDocument);
const document = hideConfidentialFields(User, updatedUser);
// return msg incl. document
res.json({ message: 'User successfully updated', document });
......
This diff is collapsed.
This diff is collapsed.
......@@ -23,30 +23,30 @@
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">96.28% </span>
<span class="strong">96.25% </span>
<span class="quiet">Statements</span>
<span class='fraction'>3214/3338</span>
<span class='fraction'>3834/3983</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">93.37% </span>
<span class="strong">93.34% </span>
<span class="quiet">Branches</span>
<span class='fraction'>423/453</span>
<span class='fraction'>519/556</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">90.38% </span>
<span class="strong">90.47% </span>
<span class="quiet">Functions</span>
<span class='fraction'>47/52</span>
<span class='fraction'>57/63</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">96.28% </span>
<span class="strong">96.25% </span>
<span class="quiet">Lines</span>
<span class='fraction'>3214/3338</span>
<span class='fraction'>3834/3983</span>
</div>
......@@ -80,17 +80,17 @@
</thead>
<tbody><tr>
<td class="file high" data-value="ragchat-api"><a href="ragchat-api/index.html">ragchat-api</a></td>
<td data-value="87.5" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 87%"></div><div class="cover-empty" style="width: 13%"></div></div>
<td data-value="85.83" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 85%"></div><div class="cover-empty" style="width: 15%"></div></div>
</td>
<td data-value="87.5" class="pct high">87.5%</td>
<td data-value="120" class="abs high">105/120</td>
<td data-value="60" class="pct medium">60%</td>
<td data-value="5" class="abs medium">3/5</td>
<td data-value="85.83" class="pct high">85.83%</td>
<td data-value="120" class="abs high">103/120</td>
<td data-value="50" class="pct medium">50%</td>
<td data-value="6" class="abs medium">3/6</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="0" class="abs high">0/0</td>
<td data-value="87.5" class="pct high">87.5%</td>
<td data-value="120" class="abs high">105/120</td>
<td data-value="85.83" class="pct high">85.83%</td>
<td data-value="120" class="abs high">103/120</td>
</tr>
<tr>
......@@ -125,47 +125,47 @@
<tr>
<td class="file high" data-value="ragchat-api/__tests__/users"><a href="ragchat-api/__tests__/users/index.html">ragchat-api/__tests__/users</a></td>
<td data-value="100" class="pic high">
<div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
<td data-value="99.53" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 99%"></div><div class="cover-empty" style="width: 1%"></div></div>
</td>
<td data-value="99.53" class="pct high">99.53%</td>
<td data-value="649" class="abs high">646/649</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="177" class="abs high">177/177</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="30" class="abs high">30/30</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="0" class="abs high">0/0</td>
<td data-value="115" class="abs high">115/115</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="177" class="abs high">177/177</td>
<td data-value="4" class="abs high">4/4</td>
<td data-value="99.53" class="pct high">99.53%</td>
<td data-value="649" class="abs high">646/649</td>
</tr>
<tr>
<td class="file high" data-value="ragchat-api/controllers"><a href="ragchat-api/controllers/index.html">ragchat-api/controllers</a></td>
<td data-value="92.61" class="pic high">
<td data-value="92.26" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 92%"></div><div class="cover-empty" style="width: 8%"></div></div>
</td>
<td data-value="92.61" class="pct high">92.61%</td>
<td data-value="474" class="abs high">439/474</td>
<td data-value="69.44" class="pct medium">69.44%</td>
<td data-value="72" class="abs medium">50/72</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="20" class="abs high">20/20</td>
<td data-value="92.61" class="pct high">92.61%</td>
<td data-value="474" class="abs high">439/474</td>
<td data-value="92.26" class="pct high">92.26%</td>
<td data-value="582" class="abs high">537/582</td>
<td data-value="68.18" class="pct medium">68.18%</td>
<td data-value="88" class="abs medium">60/88</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="25" class="abs high">25/25</td>
<td data-value="92.26" class="pct high">92.26%</td>
<td data-value="582" class="abs high">537/582</td>
</tr>
<tr>
<td class="file high" data-value="ragchat-api/models"><a href="ragchat-api/models/index.html">ragchat-api/models</a></td>
<td data-value="84.25" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 84%"></div><div class="cover-empty" style="width: 16%"></div></div>
<td data-value="80.86" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 80%"></div><div class="cover-empty" style="width: 20%"></div></div>
</td>
<td data-value="84.25" class="pct high">84.25%</td>
<td data-value="216" class="abs high">182/216</td>
<td data-value="80.86" class="pct high">80.86%</td>
<td data-value="230" class="abs high">186/230</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="0" class="abs high">0/0</td>
<td data-value="0" class="pct low">0%</td>
<td data-value="2" class="abs low">0/2</td>
<td data-value="84.25" class="pct high">84.25%</td>
<td data-value="216" class="abs high">182/216</td>
<td data-value="80.86" class="pct high">80.86%</td>
<td data-value="230" class="abs high">186/230</td>
</tr>
<tr>
......@@ -174,28 +174,28 @@
<div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="272" class="abs high">272/272</td>
<td data-value="305" class="abs high">305/305</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="0" class="abs high">0/0</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="0" class="abs high">0/0</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="272" class="abs high">272/272</td>
<td data-value="305" class="abs high">305/305</td>
</tr>
<tr>
<td class="file high" data-value="ragchat-api/utils"><a href="ragchat-api/utils/index.html">ragchat-api/utils</a></td>
<td data-value="90.25" class="pic high">
<td data-value="90.33" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 90%"></div><div class="cover-empty" style="width: 10%"></div></div>
</td>
<td data-value="90.25" class="pct high">90.25%</td>
<td data-value="390" class="abs high">352/390</td>
<td data-value="90.33" class="pct high">90.33%</td>
<td data-value="393" class="abs high">355/393</td>
<td data-value="89.09" class="pct high">89.09%</td>
<td data-value="55" class="abs high">49/55</td>
<td data-value="84.21" class="pct high">84.21%</td>
<td data-value="19" class="abs high">16/19</td>
<td data-value="90.25" class="pct high">90.25%</td>
<td data-value="390" class="abs high">352/390</td>
<td data-value="90.33" class="pct high">90.33%</td>
<td data-value="393" class="abs high">355/393</td>
</tr>
<tr>
......@@ -204,13 +204,13 @@
<div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="80" class="abs high">80/80</td>
<td data-value="95" class="abs high">95/95</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="4" class="abs high">4/4</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="4" class="abs high">4/4</td>
<td data-value="5" class="abs high">5/5</td>
<td data-value="83.33" class="pct high">83.33%</td>
<td data-value="6" class="abs high">5/6</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="80" class="abs high">80/80</td>
<td data-value="95" class="abs high">95/95</td>
</tr>
</tbody>
......@@ -221,7 +221,7 @@
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2024-08-07T16:05:11.081Z
at 2024-08-10T19:41:18.357Z
</div>
<script src="prettify.js"></script>
<script>
......
......@@ -943,7 +943,7 @@ describe('ai chat with model', () =&gt; {
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2024-08-07T16:05:11.081Z
at 2024-08-10T19:41:18.357Z
</div>
<script src="../../../prettify.js"></script>
<script>
......
......@@ -685,7 +685,7 @@ describe('ai get users chats', () =&gt; {
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2024-08-07T16:05:11.081Z
at 2024-08-10T19:41:18.357Z
</div>
<script src="../../../prettify.js"></script>
<script>
......
......@@ -631,7 +631,7 @@ describe('ai delete model', () =&gt; {
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2024-08-07T16:05:11.081Z
at 2024-08-10T19:41:18.357Z
</div>
<script src="../../../prettify.js"></script>
<script>
......
......@@ -191,7 +191,7 @@
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2024-08-07T16:05:11.081Z
at 2024-08-10T19:41:18.357Z
</div>
<script src="../../../prettify.js"></script>
<script>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment