forked from sombochea/verdaccio-ui
This commit is contained in:
committed by
GitHub
parent
ee74474811
commit
d955268c25
@@ -17,18 +17,14 @@ describe('utils', () => {
|
||||
expect(isEmail('')).toBeFalsy();
|
||||
});
|
||||
|
||||
test('getRegistryURL() - should not change when location change', () => {
|
||||
expect(getRegistryURL()).toBe('http://localhost');
|
||||
test('getRegistryURL() - should keep slash if location is a sub directory', () => {
|
||||
history.pushState({}, 'page title', '/-/web/detail');
|
||||
expect(getRegistryURL()).toBe('http://localhost');
|
||||
expect(getRegistryURL()).toBe('http://localhost/-/web/detail');
|
||||
history.pushState({}, 'page title', '/');
|
||||
});
|
||||
|
||||
test('getRegistryURL() - should change when UI options change', () => {
|
||||
test('getRegistryURL() - should not add slash if location is not a sub directory', () => {
|
||||
expect(getRegistryURL()).toBe('http://localhost');
|
||||
window.__VERDACCIO_BASENAME_UI_OPTIONS.base = 'http://localhost/test';
|
||||
expect(getRegistryURL()).toBe('http://localhost/test');
|
||||
window.__VERDACCIO_BASENAME_UI_OPTIONS.base = 'http://localhost';
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user