Commit 3aa25394 authored by Natalia Tepluhina's avatar Natalia Tepluhina

Merge branch...

Merge branch '217163-linking-to-designs-from-within-an-issue-description-alert-launches' into 'master'

Updated redirect logic to not take route changes into account

See merge request gitlab-org/gitlab!31511
parents e5ce5edb 98b921bd
......@@ -295,7 +295,7 @@ export default {
.then(res => res.data)
.then(data => this.checkForSpam(data))
.then(data => {
if (window.location.pathname !== data.web_url) {
if (!window.location.pathname.includes(data.web_url)) {
visitUrl(data.web_url);
}
})
......
......@@ -221,6 +221,19 @@ describe('Issuable output', () => {
});
});
it('does not redirect if issue has not moved and user has switched tabs', () => {
jest.spyOn(vm.service, 'updateIssuable').mockResolvedValue({
data: {
web_url: '',
confidential: vm.isConfidential,
},
});
return vm.updateIssuable().then(() => {
expect(visitUrl).not.toHaveBeenCalled();
});
});
it('redirects if returned web_url has changed', () => {
jest.spyOn(vm.service, 'updateIssuable').mockResolvedValue({
data: {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment