diff options
-rw-r--r-- | setup.py | 4 | ||||
-rw-r--r-- | test/mitmproxy/contentviews/test_xml_html.py | 2 | ||||
-rw-r--r-- | web/src/js/__tests__/ducks/ui/flowSpec.js | 35 |
3 files changed, 37 insertions, 4 deletions
@@ -66,9 +66,9 @@ setup( "construct>=2.8, <2.9", "cryptography>=1.3, <1.9", "cssutils>=1.0.1, <1.1", - "h2>=2.5.1, <3", + "h2>=2.6.1, <3", "html2text>=2016.1.8, <=2016.9.19", - "hyperframe>=4.0.1, <5", + "hyperframe>=4.0.2, <6", "jsbeautifier>=1.6.3, <1.7", "kaitaistruct>=0.6, <0.7", "passlib>=1.6.5, <1.8", diff --git a/test/mitmproxy/contentviews/test_xml_html.py b/test/mitmproxy/contentviews/test_xml_html.py index 899ecfde..2b0aee4d 100644 --- a/test/mitmproxy/contentviews/test_xml_html.py +++ b/test/mitmproxy/contentviews/test_xml_html.py @@ -23,7 +23,7 @@ def test_format_xml(filename): path = data.path(filename) with open(path) as f: input = f.read() - with open(path.replace(".", "-formatted.")) as f: + with open("-formatted.".join(path.rsplit(".", 1))) as f: expected = f.read() tokens = xml_html.tokenize(input) assert xml_html.format_xml(tokens) == expected diff --git a/web/src/js/__tests__/ducks/ui/flowSpec.js b/web/src/js/__tests__/ducks/ui/flowSpec.js index 91b56746..e994624d 100644 --- a/web/src/js/__tests__/ducks/ui/flowSpec.js +++ b/web/src/js/__tests__/ducks/ui/flowSpec.js @@ -9,12 +9,28 @@ import reducer, { setShowFullContent, setContent, updateEdit, - stopEdit + stopEdit, + setContentView, + selectTab, + displayLarge } from '../../../ducks/ui/flow' import { select, updateFlow } from '../../../ducks/flows' describe('flow reducer', () => { + it('should return initial state', () => { + expect(reducer(undefined, {})).toEqual({ + displayLarge: false, + viewDescription: '', + showFullContent: false, + modifiedFlow: false, + contentView: 'Auto', + tab: 'request', + content: [], + maxContentLines: 80, + }) + }) + it('should change to edit mode', () => { let testFlow = {flow : 'foo'} const newState = reducer(undefined, startEdit({ flow: 'foo' })) @@ -74,4 +90,21 @@ describe('flow reducer', () => { let updatedFlow = {id: 1} expect(reducer({modifiedFlow}, stopEdit(updatedFlow, modifiedFlow)).modifiedFlow).toBeFalsy() }) + + it('should set content view', () => { + let state = reducer(undefined, setContentView('Edit')) + expect(state.contentView).toEqual('Edit') + expect(state.showFullContent).toBeTruthy() + }) + + it('should select different tabs', () => { + let state = reducer(undefined, selectTab('response')) + expect(state.tab).toEqual('response') + expect(state.displayLarge).toBeFalsy() + expect(state.showFullContent).toBeFalsy() + }) + + it('should display large', () => { + expect(reducer(undefined, displayLarge()).displayLarge).toBeTruthy() + }) }) |