test(coverage): drive browser tests to 80% on all metrics (#496) #505
@@ -249,4 +249,54 @@ describe('documents/[id] page', () => {
|
|||||||
})
|
})
|
||||||
).not.toThrow();
|
).not.toThrow();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('renders without throwing with all metadata populated', async () => {
|
||||||
|
mockPage.url = new URL('http://localhost/documents/d-meta');
|
||||||
|
expect(() =>
|
||||||
|
render(DocumentDetailPage, {
|
||||||
|
props: {
|
||||||
|
data: baseData({
|
||||||
|
document: {
|
||||||
|
...baseDoc,
|
||||||
|
id: 'd-meta',
|
||||||
|
sender: { id: 's1', displayName: 'Anna' },
|
||||||
|
receivers: [
|
||||||
|
{ id: 'r1', displayName: 'Bert' },
|
||||||
|
{ id: 'r2', displayName: 'Carl' }
|
||||||
|
],
|
||||||
|
tags: [
|
||||||
|
{ id: 't1', name: 'Familie' },
|
||||||
|
{ id: 't2', name: 'Reise' }
|
||||||
|
],
|
||||||
|
location: 'Berlin',
|
||||||
|
scriptType: 'KURRENT',
|
||||||
|
trainingLabels: ['KURRENT_RECOGNITION']
|
||||||
|
},
|
||||||
|
user: { id: 'u1', firstName: 'Anna' },
|
||||||
|
geschichten: [{ id: 'g1', title: 'Story', publishedAt: null }],
|
||||||
|
inferredRelationship: { labelFromA: 'Vater', labelFromB: 'Tochter' },
|
||||||
|
canBlogWrite: true,
|
||||||
|
canWrite: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
).not.toThrow();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('renders the transcribe-mode forced via query string', async () => {
|
||||||
|
mockPage.url = new URL('http://localhost/documents/d-task?task=transcribe');
|
||||||
|
render(DocumentDetailPage, {
|
||||||
|
props: {
|
||||||
|
data: baseData({
|
||||||
|
document: { ...baseDoc, id: 'd-task' },
|
||||||
|
canWrite: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
await new Promise((r) => setTimeout(r, 80));
|
||||||
|
// DocumentTopBar should mount; transcribeMode flag was set by the URL param
|
||||||
|
const main = document.body.firstElementChild;
|
||||||
|
expect(main).not.toBeNull();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user