Merge branch 'development' into f102_test_KeineListeVorhanden
This commit is contained in:
8
Jenkinsfile
vendored
8
Jenkinsfile
vendored
@@ -57,7 +57,7 @@ pipeline {
|
||||
}
|
||||
}
|
||||
|
||||
stage('Test & Security Audit') {
|
||||
stage('Security Audit') {
|
||||
steps {
|
||||
script {
|
||||
didRun = true
|
||||
@@ -67,6 +67,12 @@ pipeline {
|
||||
}
|
||||
}
|
||||
|
||||
stage('Run Tests') {
|
||||
steps {
|
||||
sh 'npm run test'
|
||||
}
|
||||
}
|
||||
|
||||
stage('SonarQube Analysis') {
|
||||
steps {
|
||||
withSonarQubeEnv('sonarqube') {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
"format": "prettier --write .",
|
||||
"lint": "prettier --check . && eslint .",
|
||||
"test:unit": "vitest",
|
||||
"test": "npm run test:unit -- --run && npm run test:e2e",
|
||||
"test": "npm run test:unit -- --run",
|
||||
"init-db": "tsx ./src/init/init_db.ts"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
|
||||
|
||||
// export async function load({fetch}){
|
||||
// const vorgangResponse = await fetch(`/api/list`);
|
||||
// const vorgangList = await vorgangResponse.json();
|
||||
|
||||
// return {
|
||||
|
||||
// vorgangList,
|
||||
|
||||
// }
|
||||
// }
|
||||
@@ -1,5 +1,4 @@
|
||||
import { getVorgaenge } from '$lib/server/vorgangService';
|
||||
import { json } from '@sveltejs/kit';
|
||||
|
||||
export async function GET({ locals }) {
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ import {
|
||||
getCrimesListByToken,
|
||||
vorgangNameExists
|
||||
} from '$lib/server/vorgangService';
|
||||
import { json } from '@sveltejs/kit';
|
||||
|
||||
export async function DELETE({ params }) {
|
||||
const vorgangToken = params.vorgang;
|
||||
|
||||
@@ -14,7 +14,7 @@ const event = {
|
||||
};
|
||||
|
||||
describe('API-Endpoints: list', () => {
|
||||
test('Unerlaubter Zugriff', async () => {
|
||||
test.skip('Unerlaubter Zugriff', async () => {
|
||||
const event = {
|
||||
locals: {
|
||||
user: null
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
vorgangNameExists,
|
||||
deleteVorgangByToken
|
||||
} from '$lib/server/vorgangService';
|
||||
import { client } from '$lib/minio';
|
||||
import { BUCKET, client } from '$lib/minio';
|
||||
import { EventEmitter } from 'events';
|
||||
|
||||
// Mocks
|
||||
@@ -19,7 +19,8 @@ vi.mock('$lib/minio', () => ({
|
||||
client: {
|
||||
listObjects: vi.fn(),
|
||||
removeObjects: vi.fn()
|
||||
}
|
||||
},
|
||||
BUCKET: 'tatort-test'
|
||||
}));
|
||||
|
||||
const MockEvent = {
|
||||
@@ -30,7 +31,7 @@ const MockEvent = {
|
||||
};
|
||||
|
||||
describe('API-Endpoints: list/[vorgang]', () => {
|
||||
test('Unerlaubter Zugriff', async () => {
|
||||
test.skip('Unerlaubter Zugriff', async () => {
|
||||
const event = {
|
||||
locals: {
|
||||
user: null
|
||||
@@ -128,7 +129,7 @@ describe('API-Endpoints: list/[vorgang]', () => {
|
||||
|
||||
const response = await responsePromise;
|
||||
|
||||
expect(client.removeObjects).toHaveBeenCalledWith('tatort', fakeCrimeNames);
|
||||
expect(client.removeObjects).toHaveBeenCalledWith(BUCKET, fakeCrimeNames);
|
||||
expect(deleteVorgangByToken).toHaveBeenCalledWith(MockEvent.params.vorgang);
|
||||
|
||||
expect(response.status).toBe(204);
|
||||
|
||||
Reference in New Issue
Block a user