mirror of
https://github.com/s-frick/effigenix.git
synced 2026-03-28 13:49:36 +01:00
init e2e ui tests base skeleton
This commit is contained in:
parent
83c7321c8f
commit
c84629cc4e
16 changed files with 1219 additions and 0 deletions
|
|
@ -0,0 +1,47 @@
|
|||
import { test, expect } from '../../../fixtures/auth.fixture.js';
|
||||
|
||||
/**
|
||||
* TC-SUP – Lieferanten
|
||||
* Quelle: GitHub Issue #63
|
||||
*/
|
||||
test.describe('TC-SUP: Lieferanten', () => {
|
||||
test('TC-SUP-01: Lieferant erstellen – Pflichtfelder', async ({ request, adminToken }) => {
|
||||
const res = await request.post('/api/suppliers', {
|
||||
data: { name: `Frisch AG ${Date.now()}`, phone: '+49 30 12345' },
|
||||
headers: { Authorization: `Bearer ${adminToken}` },
|
||||
});
|
||||
expect(res.status()).toBe(201);
|
||||
const body = await res.json();
|
||||
expect(body.status).toBe('AKTIV');
|
||||
});
|
||||
|
||||
test('TC-SUP-02: Lieferant erscheint in Liste nach Erstellung', async ({ request, adminToken }) => {
|
||||
const name = `ListTest-${Date.now()}`;
|
||||
await request.post('/api/suppliers', {
|
||||
data: { name, phone: '+49 30 99999' },
|
||||
headers: { Authorization: `Bearer ${adminToken}` },
|
||||
});
|
||||
const res = await request.get('/api/suppliers', {
|
||||
headers: { Authorization: `Bearer ${adminToken}` },
|
||||
});
|
||||
expect(res.status()).toBe(200);
|
||||
const body = await res.json();
|
||||
const found = (Array.isArray(body) ? body : body.content ?? []).some(
|
||||
(s: { name: string }) => s.name === name,
|
||||
);
|
||||
expect(found).toBe(true);
|
||||
});
|
||||
|
||||
test('TC-SUP-03: Lieferant ohne Name wird abgelehnt', async ({ request, adminToken }) => {
|
||||
const res = await request.post('/api/suppliers', {
|
||||
data: { phone: '+49 30 12345' },
|
||||
headers: { Authorization: `Bearer ${adminToken}` },
|
||||
});
|
||||
expect(res.status()).toBe(400);
|
||||
});
|
||||
|
||||
// TODO: Weitere TCs aus Issue #63 nach Implementierung hinzufügen
|
||||
// TC-SUP-04: Doppelter Name abgelehnt
|
||||
// TC-SUP-05: Lieferant deaktivieren
|
||||
// TC-SUP-06: Filter nach Name
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue