endpoint renaming paths

This commit is contained in:
2023-10-24 22:46:40 -04:00
parent 66012e9db4
commit 6addd5af30
9 changed files with 129 additions and 160 deletions

View File

@@ -9,7 +9,6 @@ import { generateIdentityProof } from '../src/crypto/idcVerifier/verifier';
import { Identity } from '@semaphore-protocol/identity';
import { doesNotReject } from 'assert';
process.env.DATABASE_URL = process.env.DATABASE_URL_TEST;
process.env.PORT = '3001';
@@ -40,7 +39,6 @@ const testIdentity = new Identity();
const username = 'admin';
const password = process.env.PASSWORD;
beforeAll(async () => {
const prismaTest = new PrismaClient();
await prismaTest.messages.deleteMany();
@@ -202,7 +200,7 @@ describe('Endpoints', () => {
const joinTest = {
code: testCode,
idc: testIdentity.getCommitment().toString(),
idc: testIdentity.getCommitment().toString()
};
await request(_app)
@@ -223,17 +221,16 @@ describe('Endpoints', () => {
});
test('It should return all rooms associated with the given identity', async () => {
let proof = await generateIdentityProof(testIdentity, BigInt(Date.now()))
let proof = await generateIdentityProof(testIdentity, BigInt(Date.now()));
await request(_app)
.get(`/room/idc/${testIdentity.getCommitment().toString()}`)
.get(`/identity/${testIdentity.getCommitment().toString()}`)
.send(proof)
.then((res) => {
try {
expect(res.statusCode).toEqual(200);
} catch (error) {
console.error('GET /api/rooms/:idc - ' + error);
}
})
.catch((error) => console.error('GET /api/rooms/:idc - ' + error));