"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "packages/grafana-data/src/utils/location.test.ts" between
grafana-8.0.0.tar.gz and grafana-8.0.1.tar.gz

About: Grafana is a visualization tool for monitoring, metric analytics and dashboards for Graphite, InfluxDB, Prometheus and many more.

location.test.ts  (grafana-8.0.0):location.test.ts  (grafana-8.0.1)
skipping to change at line 37 skipping to change at line 37
describe('strip base when appSubUrl configured', () => { describe('strip base when appSubUrl configured', () => {
beforeEach(() => { beforeEach(() => {
locationUtil.initialize({ locationUtil.initialize({
config: { appSubUrl: '/subUrl' } as any, config: { appSubUrl: '/subUrl' } as any,
getVariablesUrlParams: (() => {}) as any, getVariablesUrlParams: (() => {}) as any,
getTimeRangeForUrl: (() => {}) as any, getTimeRangeForUrl: (() => {}) as any,
}); });
}); });
test('relative url', () => { test('relative url', () => {
const urlWithoutMaster = locationUtil.stripBaseFromUrl('/subUrl/grafana/') const urlWithoutMaster = locationUtil.stripBaseFromUrl('/subUrl/thisShould
; Remain/');
expect(urlWithoutMaster).toBe('/grafana/'); expect(urlWithoutMaster).toBe('/thisShouldRemain/');
}); });
test('absolute url url', () => { test('relative url with multiple subUrl in path', () => {
const urlWithoutMaster = locationUtil.stripBaseFromUrl('http://www.domain. const urlWithoutMaster = locationUtil.stripBaseFromUrl('/subUrl/thisShould
com:9877/subUrl/grafana/'); Remain/subUrl/');
expect(urlWithoutMaster).toBe('/grafana/'); expect(urlWithoutMaster).toBe('/thisShouldRemain/subUrl/');
});
test('relative url with subdirectory subUrl', () => {
const urlWithoutMaster = locationUtil.stripBaseFromUrl('/thisShouldRemain/
subUrl/');
expect(urlWithoutMaster).toBe('/thisShouldRemain/subUrl/');
});
test('absolute url', () => {
const urlWithoutMaster = locationUtil.stripBaseFromUrl('http://www.domain.
com:9877/subUrl/thisShouldRemain/');
expect(urlWithoutMaster).toBe('/thisShouldRemain/');
});
test('absolute url with multiple subUrl in path', () => {
const urlWithoutMaster = locationUtil.stripBaseFromUrl(
'http://www.domain.com:9877/subUrl/thisShouldRemain/subUrl/'
);
expect(urlWithoutMaster).toBe('/thisShouldRemain/subUrl/');
});
test('absolute url with subdirectory subUrl', () => {
const urlWithoutMaster = locationUtil.stripBaseFromUrl('http://www.domain.
com:9877/thisShouldRemain/subUrl/');
expect(urlWithoutMaster).toBe('/thisShouldRemain/subUrl/');
}); });
}); });
describe('strip base when appSubUrl not configured', () => { describe('strip base when appSubUrl not configured', () => {
beforeEach(() => { beforeEach(() => {
locationUtil.initialize({ locationUtil.initialize({
config: {} as any, config: {} as any,
getVariablesUrlParams: (() => {}) as any, getVariablesUrlParams: (() => {}) as any,
getTimeRangeForUrl: (() => {}) as any, getTimeRangeForUrl: (() => {}) as any,
}); });
 End of changes. 2 change blocks. 
7 lines changed or deleted 28 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)