Skip to content

Commit ac4e624

Browse files
committed
test(paypal): add fake credentials
1 parent 6fca667 commit ac4e624

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

test/fixtures/basic/nuxt.config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ export default defineNuxtConfig({
4646
webhookId: 'testPaddleWebhookId',
4747
},
4848
paypal: {
49-
clientId: '',
50-
secretKey: '',
51-
webhookId: '',
49+
clientId: 'testPayPalClientId',
50+
secretKey: 'testPayPalSecretKey',
51+
webhookId: 'testPayPalWebhookId',
5252
},
5353
resend: {
5454
secretKey: 'test_c3ZpeFNlY3JldEtleQ==',

test/module.test.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@ describe('ensureConfiguration method', () => {
2828
if (!nuxtConfig.runtimeConfig?.webhook) return
2929
for (const [key, config] of Object.entries(nuxtConfig.runtimeConfig.webhook)) {
3030
const provider = key as keyof RuntimeConfig['webhook']
31-
if (provider === 'paypal') {
32-
expect(() => ensureConfiguration(provider)).toThrowError()
33-
continue
34-
}
3531
const resultConfig = ensureConfiguration(provider)
3632
expect(resultConfig).toStrictEqual(config)
3733
}

test/simulations/paypal.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { vi } from 'vitest'
22

33
export const simulatePaypalEvent = async () => {
44
vi.stubGlobal('$fetch', () => new Promise(resolve => resolve({ isValidWebhook: true })))
5-
// Stubbing $fetch to return a valid webhook response
5+
// Stubbing $fetch to return a valid webhook response since not testing actual PayPal API here
66
const response = await $fetch('/api/webhooks/paypal', {
77
method: 'POST',
88
})

0 commit comments

Comments
 (0)