mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-10-16 06:53:30 +08:00
Merge pull request #6257 from 88766lawrence/fix/oauth-promo-code-6216
fix(auth): preserve promo codes through OAuth registration
This commit is contained in:
@@ -80,6 +80,29 @@ describe('EmailOAuthButtons', () => {
|
||||
expect(window.location.href).toBe(originalHref)
|
||||
})
|
||||
|
||||
it('omits an empty promo code from the OAuth request', async () => {
|
||||
const wrapper = mount(EmailOAuthButtons, {
|
||||
props: {
|
||||
githubEnabled: true,
|
||||
googleEnabled: false,
|
||||
promoCode: ' ',
|
||||
},
|
||||
global: {
|
||||
stubs: {
|
||||
GitHubMark: true,
|
||||
GoogleMark: true,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
await wrapper.get('button').trigger('click')
|
||||
|
||||
expect(wrapper.emitted('start')?.[0]?.[0]).toEqual({
|
||||
provider: 'github',
|
||||
params: { redirect: '/billing?plan=pro', aff_code: 'AFF123' }
|
||||
})
|
||||
})
|
||||
|
||||
it('uses a full-width descriptive button when only GitHub is enabled', () => {
|
||||
const wrapper = mount(EmailOAuthButtons, {
|
||||
props: {
|
||||
|
||||
Reference in New Issue
Block a user