mirror of
https://github.com/grafana/grafana.git
synced 2026-08-14 07:04:57 -05:00
Urls: Parsing key values will not convert to numbers (#33982)
* Urls: Parsing key values will not convert to numbers * Tests: fixes broken tests * Tests: fixes broken test * Tests: fixes broken test * Chore: forcing drone to rebuild
This commit is contained in:
@@ -85,19 +85,19 @@ describe('AngularLocationWrapper', () => {
|
||||
|
||||
it('search() should accept object', function () {
|
||||
locationService.push('/path/b');
|
||||
wrapper.search({ one: 1, two: true });
|
||||
expect(wrapper.search()).toEqual({ one: 1, two: true });
|
||||
wrapper.search({ one: '1', two: true });
|
||||
expect(wrapper.search()).toEqual({ one: '1', two: true });
|
||||
expect(wrapper.absUrl()).toBe('http://www.domain.com:9877/path/b?one=1&two');
|
||||
});
|
||||
|
||||
it('should copy object', function () {
|
||||
locationService.push('/path/b');
|
||||
const obj: Record<string, any> = { one: 1, two: true, three: null };
|
||||
const obj: Record<string, any> = { one: '1', two: true, three: null };
|
||||
wrapper.search(obj);
|
||||
expect(obj).toEqual({ one: 1, two: true, three: null });
|
||||
expect(obj).toEqual({ one: '1', two: true, three: null });
|
||||
obj.one = 'changed';
|
||||
|
||||
expect(wrapper.search()).toEqual({ one: 1, two: true });
|
||||
expect(wrapper.search()).toEqual({ one: '1', two: true });
|
||||
expect(wrapper.absUrl()).toBe('http://www.domain.com:9877/path/b?one=1&two');
|
||||
});
|
||||
|
||||
@@ -117,8 +117,8 @@ describe('AngularLocationWrapper', () => {
|
||||
|
||||
it('should remove multiple parameters', function () {
|
||||
locationService.push('/path/b');
|
||||
wrapper.search({ one: 1, two: true });
|
||||
expect(wrapper.search()).toEqual({ one: 1, two: true });
|
||||
wrapper.search({ one: '1', two: true });
|
||||
expect(wrapper.search()).toEqual({ one: '1', two: true });
|
||||
|
||||
wrapper.search({ one: null, two: null });
|
||||
expect(wrapper.search()).toEqual({});
|
||||
|
||||
Reference in New Issue
Block a user