Skip to content

Commit b339cee

Browse files
authored
[CI-3445] Stop changing url path (#73)
1 parent 8dfd620 commit b339cee

File tree

3 files changed

+2
-18
lines changed

3 files changed

+2
-18
lines changed

spec/urlHelpers.test.tsx

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,6 @@ describe('Testing Default UrlHelpers: getUrlFromState', () => {
7272
expect(params.has(testRequestState.filterName)).toBe(false);
7373
expect(params.has(testRequestState.filterValue)).toBe(false);
7474
});
75-
76-
test('Should encode filterName and filterValue as part of the path', () => {
77-
const urlString = getUrlFromState(testRequestState as RequestConfigs, {
78-
baseUrl: 'https://www.example.com/a/random/path',
79-
});
80-
const url = new URL(urlString);
81-
const paths = url.pathname.split('/');
82-
83-
expect(paths.indexOf(testRequestState.filterName)).not.toBe(-1);
84-
expect(paths.indexOf(testRequestState.filterValue)).not.toBe(-1);
85-
});
8675
});
8776

8877
describe('Testing Default UrlHelpers: getStateFromUrl', () => {

spec/useBrowseResults.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ describe('Testing Hook: useBrowseResults', () => {
5757

5858
const url = getUrlFromState(
5959
{ filterValue: '123', filters, resultsPerPage, page },
60-
{ baseUrl: 'https://example.com/browse/' },
60+
{ baseUrl: 'https://example.com/browse/123' },
6161
);
6262
mockLocation.href = url;
6363

src/utils/urlHelpers.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,5 @@ export function getUrlFromState(
131131
}
132132
});
133133

134-
let groupPath = '';
135-
if (state.filterValue) {
136-
groupPath = `/${state.filterName}/${state.filterValue}`;
137-
}
138-
139-
return `${baseUrl}${groupPath}?${params.toString()}`;
134+
return `${baseUrl}?${params.toString()}`;
140135
}

0 commit comments

Comments
 (0)