test(coverage): drive browser tests to 80% on all metrics (#496) #505
@@ -91,4 +91,35 @@ describe('home page (/)', () => {
|
||||
const section = document.querySelector('section[aria-label]');
|
||||
expect(section).not.toBeNull();
|
||||
});
|
||||
|
||||
it('renders the reader stats counts when isReader is true and stats are provided', async () => {
|
||||
render(HomePage, {
|
||||
props: {
|
||||
data: baseData({
|
||||
isReader: true,
|
||||
user: { firstName: 'Anna' },
|
||||
readerStats: { totalDocuments: 50, totalPersons: 20, totalStories: 5 }
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
expect(document.body.textContent).toContain('50');
|
||||
expect(document.body.textContent).toContain('20');
|
||||
});
|
||||
|
||||
it('renders ReaderRecentDocs and ReaderRecentStories grid in reader view', async () => {
|
||||
render(HomePage, {
|
||||
props: {
|
||||
data: baseData({
|
||||
isReader: true,
|
||||
user: { firstName: 'Anna' },
|
||||
recentDocs: [],
|
||||
recentStories: []
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
const grids = document.querySelectorAll('.grid.grid-cols-1');
|
||||
expect(grids.length).toBeGreaterThan(0);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user