Skip to content

Commit

Permalink
remove obsolete duplicate tests
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanBabukov committed Jul 22, 2022
1 parent d91460c commit 699e35a
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions tests/api.v2/middlewares/authMiddlewares.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,19 +130,6 @@ describe('Tests for authorization/authentication middlewares', () => {
await expect(expressAuthenticationOnlyMiddleware(req, {}, next)).rejects;
});

it('Express middleware can authorize correct users', async () => {
const req = {
params: { experimentId: fake.EXPERIMENT_ID },
user: fake.USER,
url: fake.RESOURCE_V1,
method: 'POST',
};
const next = jest.fn();

await expressAuthorizationMiddleware(req, {}, next);
expect(next).toBeCalledWith();
});

it('checkAuth accepts expired tokens for patch cellsets', async () => {
const req = {
params: { experimentId: fake.EXPERIMENT_ID },
Expand All @@ -157,19 +144,6 @@ describe('Tests for authorization/authentication middlewares', () => {
expect(ret).toBe(null);
});

it('Express middleware can reject incorrect users', async () => {
const req = {
params: { experimentId: fake.EXPERIMENT_ID },
user: 'another-user-id',
url: fake.RESOURCE_V1,
method: 'POST',
};
const next = jest.fn();

await expressAuthorizationMiddleware(req, {}, next);
expect(next).toBeCalledWith(expect.any(UnauthorizedError));
});

it('Express middleware can reject unauthenticated requests', async () => {
const req = {
params: { experimentId: fake.EXPERIMENT_ID },
Expand Down

0 comments on commit 699e35a

Please sign in to comment.