Skip to content

Commit

Permalink
chore: #1185 add some test
Browse files Browse the repository at this point in the history
  • Loading branch information
An Duong committed May 13, 2020
1 parent 415fe23 commit aed19ca
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 65 deletions.
Original file line number Diff line number Diff line change
@@ -1,34 +1,15 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`WebhookTestModal should WebhookTestModal match a snapshot 1`] = `
<ContextProvider
value={
<Provider
store={
Object {
"store": Object {
"clearActions": [Function],
"dispatch": [Function],
"getActions": [Function],
"getState": [Function],
"replaceReducer": [Function],
"subscribe": [Function],
},
"subscription": Subscription {
"handleChangeWrapper": [Function],
"listeners": Object {
"notify": [Function],
},
"onStateChange": [Function],
"parentSub": undefined,
"store": Object {
"clearActions": [Function],
"dispatch": [Function],
"getActions": [Function],
"getState": [Function],
"replaceReducer": [Function],
"subscribe": [Function],
},
"unsubscribe": null,
},
"clearActions": [Function],
"dispatch": [Function],
"getActions": [Function],
"getState": [Function],
"replaceReducer": [Function],
"subscribe": [Function],
}
}
>
Expand All @@ -37,42 +18,34 @@ exports[`WebhookTestModal should WebhookTestModal match a snapshot 1`] = `
closeModal={[MockFunction]}
visible={true}
webhookId="webhookId"
/>
</ContextProvider>
>
<Component
afterClose={[MockFunction]}
renderChildren={true}
visible={true}
/>
</Component>
</Provider>
`;

exports[`WebhookTestModal should WebhookTestResultModal match a snapshot 1`] = `
<ContextProvider
value={
<Provider
store={
Object {
"store": Object {
"clearActions": [Function],
"dispatch": [Function],
"getActions": [Function],
"getState": [Function],
"replaceReducer": [Function],
"subscribe": [Function],
},
"subscription": Subscription {
"handleChangeWrapper": [Function],
"listeners": Object {
"notify": [Function],
},
"onStateChange": [Function],
"parentSub": undefined,
"store": Object {
"clearActions": [Function],
"dispatch": [Function],
"getActions": [Function],
"getState": [Function],
"replaceReducer": [Function],
"subscribe": [Function],
},
"unsubscribe": null,
},
"clearActions": [Function],
"dispatch": [Function],
"getActions": [Function],
"getState": [Function],
"replaceReducer": [Function],
"subscribe": [Function],
}
}
>
<Component />
</ContextProvider>
<Component>
<Component
renderChildren={true}
visible={false}
/>
</Component>
</Provider>
`;
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { shallow } from 'enzyme'
import { mount } from 'enzyme'
import {
generateTopicOptions,
fetchWebhookData,
Expand All @@ -10,6 +10,7 @@ import {
WebhookTestModal,
GenerateTopicOptions,
} from '../webhook-test-modal'
import * as TestModal from '../webhook-test-modal'
import { ReduxState } from '@/types/core'
import * as ReactRedux from 'react-redux'
import { developerState } from '@/sagas/__stubs__/developer'
Expand Down Expand Up @@ -39,8 +40,9 @@ describe('WebhookTestModal', () => {
// spyDispatch = jest.spyOn(ReactRedux, 'useDispatch').mockImplementation(() => store.dispatch)
})
it('should WebhookTestModal match a snapshot', () => {
spyOn(TestModal, 'generateTopicOptions').and.returnValue([])
expect(
shallow(
mount(
<ReactRedux.Provider store={store}>
<WebhookTestModal {...props} />
</ReactRedux.Provider>,
Expand All @@ -50,7 +52,7 @@ describe('WebhookTestModal', () => {

it('should WebhookTestResultModal match a snapshot', () => {
expect(
shallow(
mount(
<ReactRedux.Provider store={store}>
<WebhookTestResultModal />
</ReactRedux.Provider>,
Expand Down
2 changes: 1 addition & 1 deletion packages/marketplace/src/tests/badges/badge-branches.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/marketplace/src/tests/badges/badge-functions.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/marketplace/src/tests/badges/badge-lines.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/marketplace/src/tests/badges/badge-statements.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit aed19ca

Please sign in to comment.