Added new card in overview to display orphan visits

This commit is contained in:
Alejandro Celaya
2021-02-21 20:55:39 +01:00
parent 3c53f7d0fc
commit 5a373fd7ae
4 changed files with 27 additions and 10 deletions

View File

@@ -32,7 +32,7 @@ describe('<Overview />', () => {
loadVisitsOverview={loadVisitsOverview}
shortUrlsList={Mock.of<ShortUrlsListState>({ loading, shortUrls })}
tagsList={Mock.of<TagsList>({ loading, tags: [ 'foo', 'bar', 'baz' ] })}
visitsOverview={Mock.of<VisitsOverview>({ loading, visitsCount: 3456 })}
visitsOverview={Mock.of<VisitsOverview>({ loading, visitsCount: 3456, orphanVisitsCount: 28 })}
selectedServer={Mock.of<ReachableServer>({ id: serverId })}
createNewVisits={jest.fn()}
loadMercureInfo={jest.fn()}
@@ -49,7 +49,7 @@ describe('<Overview />', () => {
const wrapper = createWrapper(true);
const cards = wrapper.find(CardText);
expect(cards).toHaveLength(3);
expect(cards).toHaveLength(4);
cards.forEach((card) => expect(card.html()).toContain('Loading...'));
});
@@ -57,10 +57,11 @@ describe('<Overview />', () => {
const wrapper = createWrapper();
const cards = wrapper.find(CardText);
expect(cards).toHaveLength(3);
expect(cards).toHaveLength(4);
expect(cards.at(0).html()).toContain(prettify(3456));
expect(cards.at(1).html()).toContain(prettify(83710));
expect(cards.at(2).html()).toContain(prettify(3));
expect(cards.at(1).html()).toContain(prettify(28));
expect(cards.at(2).html()).toContain(prettify(83710));
expect(cards.at(3).html()).toContain(prettify(3));
});
test('first card displays warning for old shlink versions', () => {