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:
Hugo Häggmark
2021-05-12 13:40:30 +02:00
committed by GitHub
parent a735c51202
commit 7a55a6385c
5 changed files with 22 additions and 18 deletions
@@ -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({});