mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-12 10:53:51 +00:00
2fa397548a
* feat/navigate upgrade react router * feat/navigate migrate to react router 6 * feat/navigate style modal * feat/navigate create endpoints for app settings * feat/navigate protect editor with pin * feat/navigate apply dynamic routing draft * feat/navigate upgrade relevant packages * feat/navigate restructure directory and add tests * feat/navigate test aliases validation * feat/navigate validate aliases before sending * feat/navigate create data endpoint * feat/navigate config: prettier * feat/navigate invalidate empty strings * feat/navigate create endpoints * feat/navigate parse on import * feat/navigate navigate to alias * feat/navigate user help and sample data * feat/navigate refact aliases modal * feat/navigate refact settings style * feat/navigate update sample db * feat/navigate link is relative to hostname * feat/navigate navigate to first match * feat/navigate update readme and version bump * feat/navigate config: create shared module * feat/navigate config: cheat module install * feat/navigate fix tests * feat/navigate run tests in pull request * Update ontime_cy.yml
27 lines
518 B
JavaScript
27 lines
518 B
JavaScript
import { validateAlias } from '../aliases';
|
|
|
|
describe('An alias fails if incorrect', () => {
|
|
|
|
const testsToFail = [
|
|
// no empty
|
|
'',
|
|
// no https, http or www
|
|
'https://www.test.com',
|
|
'http://www.test.com',
|
|
'www.test.com',
|
|
// no hostname
|
|
'localhost/test',
|
|
'127.0.0.1/test',
|
|
'0.0.0.0/test',
|
|
// no editor
|
|
'editor',
|
|
'editor?test'
|
|
];
|
|
|
|
testsToFail.forEach((t) => (
|
|
test(`${t}`, () => {
|
|
expect(validateAlias(t).status).toBeFalsy();
|
|
})
|
|
)
|
|
);
|
|
}); |