[Share] The redirect app path should not appear in the browser history (#117155) (#117309)

* the redirect app path should not appear in the browser history

* updated jest test to also expect replace

* added comment

* update jest test
This commit is contained in:
Jean-Louis Leysens 2021-11-03 16:32:36 +01:00 committed by GitHub
parent 275a4ed103
commit ba7667ebbf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 7 deletions

View file

@ -57,9 +57,12 @@ describe('on page mount', () => {
})
)}`
);
expect(spy).toHaveBeenCalledWith({
foo: 'bar',
});
expect(spy).toHaveBeenCalledWith(
{
foo: 'bar',
},
{ replace: true }
);
});
test('migrates parameters on-the-fly to the latest version', async () => {
@ -73,9 +76,12 @@ describe('on page mount', () => {
})
)}`
);
expect(spy).toHaveBeenCalledWith({
num: 2,
});
expect(spy).toHaveBeenCalledWith(
{
num: 2,
},
{ replace: true }
);
});
test('throws if locator does not exist', async () => {

View file

@ -66,7 +66,9 @@ export class RedirectManager {
});
locator
.navigate(migratedParams)
.navigate(migratedParams, {
replace: true, // We do not want the redirect app URL to appear in browser navigation history
})
.then()
.catch((error) => {
// eslint-disable-next-line no-console