mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-01 05:06:39 +00:00
Updated charts to allow optional pagination
This commit is contained in:
@@ -15,7 +15,7 @@ describe('<SortableBarGraph />', () => {
|
||||
Foo: 100,
|
||||
Bar: 50,
|
||||
};
|
||||
const createWrapper = (extraHeaderContent = []) => {
|
||||
const createWrapper = (extraHeaderContent) => {
|
||||
wrapper = shallow(
|
||||
<SortableBarGraph title="Foo" stats={stats} sortingItems={sortingItems} extraHeaderContent={extraHeaderContent} />
|
||||
);
|
||||
@@ -53,24 +53,19 @@ describe('<SortableBarGraph />', () => {
|
||||
};
|
||||
});
|
||||
|
||||
// eslint-disable-next-line no-magic-numbers
|
||||
it('name - ASC', (done) => assert('name', 'ASC', [ 'Bar', 'Foo' ], [ 50, 100 ], done));
|
||||
|
||||
// eslint-disable-next-line no-magic-numbers
|
||||
it('name - DESC', (done) => assert('name', 'DESC', [ 'Foo', 'Bar' ], [ 100, 50 ], done));
|
||||
|
||||
// eslint-disable-next-line no-magic-numbers
|
||||
it('value - ASC', (done) => assert('value', 'ASC', [ 'Bar', 'Foo' ], [ 50, 100 ], done));
|
||||
|
||||
// eslint-disable-next-line no-magic-numbers
|
||||
it('value - DESC', (done) => assert('value', 'DESC', [ 'Foo', 'Bar' ], [ 100, 50 ], done));
|
||||
});
|
||||
|
||||
it('renders extra header functions', () => {
|
||||
const wrapper = createWrapper([
|
||||
() => <span className="foo-span">Foo</span>,
|
||||
() => <span className="bar-span">Bar</span>,
|
||||
]);
|
||||
const wrapper = createWrapper((
|
||||
<React.Fragment>
|
||||
<span className="foo-span">Foo</span>
|
||||
<span className="bar-span">Bar</span>
|
||||
</React.Fragment>
|
||||
));
|
||||
|
||||
expect(wrapper.find('.foo-span')).toHaveLength(1);
|
||||
expect(wrapper.find('.bar-span')).toHaveLength(1);
|
||||
|
||||
Reference in New Issue
Block a user