Tickets: Bezug zu Ressource oder Domain wählen, Verknüpfung direkt aus der Domain-Aufstellung
This commit is contained in:
parent
43dc5bc827
commit
a1472617b9
6 changed files with 62 additions and 18 deletions
|
|
@ -111,3 +111,22 @@ describe('Ticket-Anhänge', () => {
|
|||
expect((await upload(A.client, `/tickets/${t.id}/messages/${manyMsgId}/attachments`, many)).statusCode).toBe(400);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Ticket-Bezug: Ressource oder Domain', () => {
|
||||
it('Ticket kann sich auf eine Ressource oder eine Domain beziehen (nie beides), fremde Zuordnung wird abgelehnt', async () => {
|
||||
const admin = await staff('link-admin@example.com', 'admin');
|
||||
const A = await customer(admin, 'Firma A', 'link-a@example.com'); const B = await customer(admin, 'Firma B', 'link-b@example.com');
|
||||
const dom = (await call(app, admin, 'POST', '/admin/domain-records', { domain: 'link-test.de', orgId: A.org })).json();
|
||||
const domB = (await call(app, admin, 'POST', '/admin/domain-records', { domain: 'link-testb.de', orgId: B.org })).json();
|
||||
|
||||
const tDom = (await call(app, A.client, 'POST', '/tickets', { orgId: A.org, subject: 'Domain zeigt Fehler', body: 'x', domainRecordId: dom.id })).json();
|
||||
const detail = (await call(app, A.client, 'GET', `/tickets/${tDom.id}`)).json();
|
||||
expect(detail.domainRecordId).toBe(dom.id); expect(detail.domain).toBe('link-test.de'); expect(detail.resourceId).toBeNull();
|
||||
|
||||
expect((await call(app, A.client, 'POST', '/tickets', { orgId: A.org, subject: 'fremde Domain', body: 'x', domainRecordId: domB.id })).statusCode).toBe(400);
|
||||
expect((await call(app, A.client, 'POST', '/tickets', { orgId: A.org, subject: 'beides', body: 'x', domainRecordId: dom.id, resourceId: dom.id })).statusCode).toBe(400);
|
||||
|
||||
const list = (await call(app, admin, 'GET', '/tickets?status=open')).json();
|
||||
expect(list.find((t: any) => t.id === tDom.id)?.domain).toBe('link-test.de');
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue