mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-10 17:43:51 +00:00
Used visits count component in short URL visits view
This commit is contained in:
@@ -11,24 +11,20 @@ describe('<VisitsHeader />', () => {
|
||||
shortUrl: 'https://doma.in/abc123',
|
||||
longUrl: 'https://foo.bar/bar/foo',
|
||||
dateCreated: '2018-01-01T10:00:00+01:00',
|
||||
visitsCount: 3,
|
||||
},
|
||||
loading: false,
|
||||
};
|
||||
const shortUrlVisits = {
|
||||
visits: [{}, {}, {}],
|
||||
};
|
||||
|
||||
beforeEach(() => {
|
||||
wrapper = shallow(
|
||||
<VisitsHeader shortUrlDetail={shortUrlDetail} shortUrlVisits={shortUrlVisits} shortLink="foo" />
|
||||
);
|
||||
wrapper = shallow(<VisitsHeader shortUrlDetail={shortUrlDetail} />);
|
||||
});
|
||||
afterEach(() => wrapper.unmount());
|
||||
|
||||
it('shows the amount of visits', () => {
|
||||
const visitsBadge = wrapper.find('.badge');
|
||||
|
||||
expect(visitsBadge.text()).toEqual(`Visits: ${shortUrlVisits.visits.length}`);
|
||||
expect(visitsBadge.html()).toContain(`Visits: <span>${shortUrlDetail.shortUrl.visitsCount}</span>`);
|
||||
});
|
||||
|
||||
it('shows when the URL was created', () => {
|
||||
|
||||
Reference in New Issue
Block a user