-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { mount } from '@vue/test-utils'; | ||
import SwagPayPalOnboardingButton from '.'; | ||
|
||
Shopware.Component.register('swag-paypal-onboarding-button', Promise.resolve(SwagPayPalOnboardingButton)); | ||
|
||
async function createWrapper() { | ||
return mount( | ||
await Shopware.Component.build('swag-paypal-onboarding-button') as typeof SwagPayPalOnboardingButton, | ||
{ | ||
global: { | ||
mocks: { $t: (key: string) => key }, | ||
provide: { | ||
acl: { can: () => true }, | ||
SwagPayPalSettingsService: { | ||
getApiCredentials: jest.fn(), | ||
Check failure on line 15 in src/Resources/app/administration/src/app/component/swag-paypal-onboarding-button/swag-paypal-onboarding-button.spec.ts GitHub Actions / eslint
Check failure on line 15 in src/Resources/app/administration/src/app/component/swag-paypal-onboarding-button/swag-paypal-onboarding-button.spec.ts GitHub Actions / eslint
|
||
}, | ||
}, | ||
}, | ||
}, | ||
); | ||
} | ||
|
||
describe('swag-paypal-onboarding-button', () => { | ||
it('should be a Vue.js component', async () => { | ||
const wrapper = await createWrapper(); | ||
|
||
expect(wrapper.vm).toBeTruthy(); | ||
Check failure on line 27 in src/Resources/app/administration/src/app/component/swag-paypal-onboarding-button/swag-paypal-onboarding-button.spec.ts GitHub Actions / eslint
Check failure on line 27 in src/Resources/app/administration/src/app/component/swag-paypal-onboarding-button/swag-paypal-onboarding-button.spec.ts GitHub Actions / eslint
|
||
}); | ||
}); |