diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 11:18:50 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 11:18:50 +0000 |
commit | 8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 (patch) | |
tree | a77e7fe7a93de11213032ed4ab1f33a3db51b738 /spec/frontend/oauth_remember_me_spec.js | |
parent | 00b35af3db1abfe813a778f643dad221aad51fca (diff) | |
download | gitlab-ce-8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781.tar.gz |
Add latest changes from gitlab-org/gitlab@13-1-stable-ee
Diffstat (limited to 'spec/frontend/oauth_remember_me_spec.js')
-rw-r--r-- | spec/frontend/oauth_remember_me_spec.js | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/spec/frontend/oauth_remember_me_spec.js b/spec/frontend/oauth_remember_me_spec.js index 381be82697e..e12db05ac43 100644 --- a/spec/frontend/oauth_remember_me_spec.js +++ b/spec/frontend/oauth_remember_me_spec.js @@ -2,6 +2,12 @@ import $ from 'jquery'; import OAuthRememberMe from '~/pages/sessions/new/oauth_remember_me'; describe('OAuthRememberMe', () => { + const findFormAction = selector => { + return $(`#oauth-container .oauth-login${selector}`) + .parent('form') + .attr('action'); + }; + preloadFixtures('static/oauth_remember_me.html'); beforeEach(() => { @@ -13,15 +19,9 @@ describe('OAuthRememberMe', () => { it('adds the "remember_me" query parameter to all OAuth login buttons', () => { $('#oauth-container #remember_me').click(); - expect($('#oauth-container .oauth-login.twitter').attr('href')).toBe( - 'http://example.com/?remember_me=1', - ); - - expect($('#oauth-container .oauth-login.github').attr('href')).toBe( - 'http://example.com/?remember_me=1', - ); - - expect($('#oauth-container .oauth-login.facebook').attr('href')).toBe( + expect(findFormAction('.twitter')).toBe('http://example.com/?remember_me=1'); + expect(findFormAction('.github')).toBe('http://example.com/?remember_me=1'); + expect(findFormAction('.facebook')).toBe( 'http://example.com/?redirect_fragment=L1&remember_me=1', ); }); @@ -30,10 +30,8 @@ describe('OAuthRememberMe', () => { $('#oauth-container #remember_me').click(); $('#oauth-container #remember_me').click(); - expect($('#oauth-container .oauth-login.twitter').attr('href')).toBe('http://example.com/'); - expect($('#oauth-container .oauth-login.github').attr('href')).toBe('http://example.com/'); - expect($('#oauth-container .oauth-login.facebook').attr('href')).toBe( - 'http://example.com/?redirect_fragment=L1', - ); + expect(findFormAction('.twitter')).toBe('http://example.com/'); + expect(findFormAction('.github')).toBe('http://example.com/'); + expect(findFormAction('.facebook')).toBe('http://example.com/?redirect_fragment=L1'); }); }); |