mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-22 07:08:10 +00:00
[web] Add tests for js/components/ContentView/DownloadContentButton.jsx
This commit is contained in:
parent
f3c2123bc7
commit
46eae0a0b6
@ -0,0 +1,15 @@
|
||||
import React from 'react'
|
||||
import renderer from 'react-test-renderer'
|
||||
import DownloadContentButton from '../../../components/ContentView/DownloadContentButton'
|
||||
import { TFlow } from '../../ducks/tutils'
|
||||
|
||||
let tflow = new TFlow()
|
||||
describe('DownloadContentButton Component', () => {
|
||||
it('should render correctly', () => {
|
||||
let downloadContentButton = renderer.create(
|
||||
<DownloadContentButton flow={tflow} message={tflow.response}/>
|
||||
),
|
||||
tree = downloadContentButton.toJSON()
|
||||
expect(tree).toMatchSnapshot()
|
||||
})
|
||||
})
|
@ -0,0 +1,13 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`DownloadContentButton Component should render correctly 1`] = `
|
||||
<a
|
||||
className="btn btn-default btn-xs"
|
||||
href="/flows/d91165be-ca1f-4612-88a9-c0f8696f3e29/response/content"
|
||||
title="Download the content of the flow."
|
||||
>
|
||||
<i
|
||||
className="fa fa-download"
|
||||
/>
|
||||
</a>
|
||||
`;
|
@ -1,3 +1,4 @@
|
||||
import React from 'react'
|
||||
import { MessageUtils } from "../../flow/utils"
|
||||
import PropTypes from 'prop-types'
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user