mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2024-12-23 09:30:31 +03:00
Added ShlinkVersions test
This commit is contained in:
parent
e761f5e1bd
commit
73e3f42614
1 changed files with 26 additions and 0 deletions
26
test/common/ShlinkVersions.test.js
Normal file
26
test/common/ShlinkVersions.test.js
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
import React from 'react';
|
||||||
|
import { shallow } from 'enzyme';
|
||||||
|
import ShlinkVersions from '../../src/common/ShlinkVersions';
|
||||||
|
|
||||||
|
describe('<ShlinkVersions />', () => {
|
||||||
|
let wrapper;
|
||||||
|
const createWrapper = (props) => {
|
||||||
|
wrapper = shallow(<ShlinkVersions {...props} />);
|
||||||
|
|
||||||
|
return wrapper;
|
||||||
|
};
|
||||||
|
|
||||||
|
afterEach(() => wrapper && wrapper.unmount());
|
||||||
|
|
||||||
|
it.each([
|
||||||
|
[ '1.2.3', 'foo', 'Client: v1.2.3 - Server: foo' ],
|
||||||
|
[ 'foo', '1.2.3', 'Client: latest - Server: 1.2.3' ],
|
||||||
|
[ 'latest', 'latest', 'Client: latest - Server: latest' ],
|
||||||
|
[ '5.5.0', '0.2.8', 'Client: v5.5.0 - Server: 0.2.8' ],
|
||||||
|
[ 'not-semver', 'something', 'Client: latest - Server: something' ],
|
||||||
|
])('displays expected versions', (clientVersion, printableVersion, expected) => {
|
||||||
|
const wrapper = createWrapper({ clientVersion, selectedServer: { printableVersion } });
|
||||||
|
|
||||||
|
expect(wrapper.text()).toEqual(expected);
|
||||||
|
});
|
||||||
|
});
|
Loading…
Reference in a new issue