digitransit-ui/digitransit-search-util/packages/digitransit-search-util-route-name-compare/test.js
2020-04-16 14:13:45 +03:00

38 lines
834 B
JavaScript

/* eslint-disable import/no-extraneous-dependencies */
import { expect } from 'chai';
import { describe, it } from 'mocha';
import routeNameCompare from '.';
const a = {
shortName: 'hki',
longName: 'Helsinki',
agency: {
name: 'hsl',
},
};
const b = {
shortName: 'hki',
longName: 'Helsinki',
agency: {
name: 'hsl',
},
};
const c = {
shortName: 'VNT',
longName: 'Vantaa',
agency: {
name: 'hsl',
},
};
describe('Testing @digitransit-search-util/digitransit-search-util-route-name-compare module', () => {
it('Checking that same routes returns 0 ', () => {
const retValue = routeNameCompare(a, b);
expect(0).to.be.equal(retValue);
});
it('Checking that different routes returns -1 ', () => {
const retValue = routeNameCompare(a, c);
expect(-1).to.be.equal(retValue);
});
});