move API protection check into hooks, adjusting corresponding tests
This commit is contained in:
@@ -14,21 +14,6 @@ const event = {
|
||||
};
|
||||
|
||||
describe('API-Endpoints: list', () => {
|
||||
test('Unerlaubter Zugriff', async () => {
|
||||
const event = {
|
||||
locals: {
|
||||
user: null
|
||||
}
|
||||
};
|
||||
|
||||
const response = await GET(event);
|
||||
expect(response.status).toBe(401);
|
||||
|
||||
const json = await response.json();
|
||||
const errorObj = { error: 'Unauthorized' };
|
||||
expect(json).toEqual(errorObj);
|
||||
});
|
||||
|
||||
test('Leere Liste wenn keine Vorgänge existieren', async () => {
|
||||
vi.mocked(getVorgaenge).mockReturnValueOnce([]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user