Added stricter types for SemVer versions

This commit is contained in:
Alejandro Celaya
2021-03-06 09:38:48 +01:00
parent b4c2fb5b8f
commit 70ce099913
7 changed files with 53 additions and 39 deletions

View File

@@ -5,6 +5,7 @@ import { ShortUrlsTable as shortUrlsTableCreator } from '../../src/short-urls/Sh
import { OrderableFields, SORTABLE_FIELDS } from '../../src/short-urls/reducers/shortUrlsListParams';
import { ShortUrlsList } from '../../src/short-urls/reducers/shortUrlsList';
import { ReachableServer, SelectedServer } from '../../src/servers/data';
import { SemVer } from '../../src/utils/helpers/version';
describe('<ShortUrlsTable />', () => {
let wrapper: ShallowWrapper;
@@ -61,10 +62,10 @@ describe('<ShortUrlsTable />', () => {
});
it.each([
[ '2.6.0' ],
[ '2.6.1' ],
[ '2.7.0' ],
[ '3.0.0' ],
[ '2.6.0' as SemVer ],
[ '2.6.1' as SemVer ],
[ '2.7.0' as SemVer ],
[ '3.0.0' as SemVer ],
])('should render composed column when server supports title', (version) => {
const wrapper = createWrapper(Mock.of<ReachableServer>({ version }));
const composedColumn = wrapper.find('table').find('th').at(2);