diff --git a/web/src/js/__tests__/components/FlowView/DetailsSpec.js b/web/src/js/__tests__/components/FlowView/DetailsSpec.js new file mode 100644 index 000000000..1b0192cff --- /dev/null +++ b/web/src/js/__tests__/components/FlowView/DetailsSpec.js @@ -0,0 +1,50 @@ +import React from 'react' +import renderer from 'react-test-renderer' +import Details, { TimeStamp, ConnectionInfo, CertificateInfo, Timing } from '../../../components/FlowView/Details' +import { TFlow } from '../../ducks/tutils' + +let tflow = TFlow() + +describe('TimeStamp Component', () => { + it('should render correctly', () => { + let timestamp = renderer.create(), + tree = timestamp.toJSON() + expect(tree).toMatchSnapshot() + // without timestamp + timestamp = renderer.create() + tree = timestamp.toJSON() + expect(tree).toMatchSnapshot() + }) +}) + +describe('ConnectionInfo Component', () => { + it('should render correctly', () => { + let connectionInfo = renderer.create(), + tree = connectionInfo.toJSON() + expect(tree).toMatchSnapshot() + }) +}) + +describe('CertificateInfo Component', () => { + it('should render correctly', () => { + let certificateInfo = renderer.create(), + tree = certificateInfo.toJSON() + expect(tree).toMatchSnapshot() + }) +}) + +describe('Timing Component', () => { + it('should render correctly', () => { + let timing = renderer.create(), + tree = timing.toJSON() + expect(tree).toMatchSnapshot() + }) +}) + +describe('Details Component', () => { + it('should render correctly', () => { + let details = renderer.create(
), + tree = details.toJSON() + expect(tree).toMatchSnapshot() + }) +}) diff --git a/web/src/js/__tests__/components/FlowView/__snapshots__/DetailsSpec.js.snap b/web/src/js/__tests__/components/FlowView/__snapshots__/DetailsSpec.js.snap new file mode 100644 index 000000000..dcee18959 --- /dev/null +++ b/web/src/js/__tests__/components/FlowView/__snapshots__/DetailsSpec.js.snap @@ -0,0 +1,274 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`CertificateInfo Component should render correctly 1`] = `
`; + +exports[`ConnectionInfo Component should render correctly 1`] = ` + + + + + + + + + + + +
+ Address: + + address:22 +
+ + TLS SNI: + + + address +
+`; + +exports[`Details Component should render correctly 1`] = ` +
+

+ Client Connection +

+ + + + + + + + + + + +
+ Address: + + address:22 +
+ + TLS SNI: + + + address +
+

+ Server Connection +

+ + + + + + + + + + + +
+ Address: + + address:22 +
+ + TLS SNI: + + + address +
+
+
+

+ Timing +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Server conn. initiated + : + + 1970-01-01 00:00:01.000 +
+ Client conn. established + : + + 1970-01-01 00:00:01.000 +
+ Server conn. TCP handshake + : + + 1970-01-01 00:00:02.000 +
+ Client conn. SSL handshake + : + + 1970-01-01 00:00:02.000 +
+ Server conn. SSL handshake + : + + 1970-01-01 00:00:03.000 +
+ First response byte + : + + 2017-05-21 12:38:32.481 +
+ Response complete + : + + 2017-05-21 12:38:32.481 +
+
+
+`; + +exports[`TimeStamp Component should render correctly 1`] = ` + + + foo + : + + + 2017-01-01 00:00:00.000 + + ( + 2min + ) + + + +`; + +exports[`TimeStamp Component should render correctly 2`] = ``; + +exports[`Timing Component should render correctly 1`] = ` +
+

+ Timing +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Server conn. initiated + : + + 1970-01-01 00:00:01.000 +
+ Client conn. established + : + + 1970-01-01 00:00:01.000 +
+ Server conn. TCP handshake + : + + 1970-01-01 00:00:02.000 +
+ Client conn. SSL handshake + : + + 1970-01-01 00:00:02.000 +
+ Server conn. SSL handshake + : + + 1970-01-01 00:00:03.000 +
+ First response byte + : + + 2017-05-21 12:38:32.481 +
+ Response complete + : + + 2017-05-21 12:38:32.481 +
+
+`;