You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zipkin.apache.org by unknown <""...@apache.org> on 2019/05/09 04:52:44 UTC

[incubator-zipkin] branch mini-timeline created (now a680825)

This is an automated email from the ASF dual-hosted git repository.

(unknown) pushed a change to branch mini-timeline
in repository https://gitbox.apache.org/repos/asf/incubator-zipkin.git.


      at a680825  Updates ui licenses to ASF header

This branch includes the following new commits:

     new ea6542c  Add step props to rc-clider range
     new a4fdc5e  Add unit tests for MiniTimeline/util.js
     new a2acd13  Add unit tests for MiniTimeline
     new 7a5dda5  Add unit tests for MiniTimelineLabel
     new 36a72d0  Add unit tests for MiniTimelineTimeMarker
     new 6bb92ae  Add unit tests for MiniTimelineSlider
     new 3a073ef  Use corsor:col-resize to MiniTimelineGraph
     new 01e1d0b  Add a simple unit test for MiniTimelineGraph
     new a680825  Updates ui licenses to ASF header

The 9 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[incubator-zipkin] 07/09: Use corsor:col-resize to MiniTimelineGraph

Posted by unknown <""...@apache.org>.
This is an automated email from the ASF dual-hosted git repository.

(unknown) pushed a commit to branch mini-timeline
in repository https://gitbox.apache.org/repos/asf/incubator-zipkin.git

commit 3a073ef7b6b9d7f8b07b1f6a1081a0b0dca9e1eb
Author: tacigar <ig...@gmail.com>
AuthorDate: Thu May 9 12:57:40 2019 +0900

    Use corsor:col-resize to MiniTimelineGraph
---
 zipkin-lens/scss/components/_mini-timeline-graph.scss | 1 +
 1 file changed, 1 insertion(+)

diff --git a/zipkin-lens/scss/components/_mini-timeline-graph.scss b/zipkin-lens/scss/components/_mini-timeline-graph.scss
index 4fcbd21..c56234b 100644
--- a/zipkin-lens/scss/components/_mini-timeline-graph.scss
+++ b/zipkin-lens/scss/components/_mini-timeline-graph.scss
@@ -3,4 +3,5 @@
   border: 1px solid $gray-9;
   border-radius: 2px;
   overflow: hidden;
+  cursor: col-resize;
 }


[incubator-zipkin] 04/09: Add unit tests for MiniTimelineLabel

Posted by unknown <""...@apache.org>.
This is an automated email from the ASF dual-hosted git repository.

(unknown) pushed a commit to branch mini-timeline
in repository https://gitbox.apache.org/repos/asf/incubator-zipkin.git

commit 7a5dda534463d5d4e227e33df8831ee52e28b41e
Author: tacigar <ig...@gmail.com>
AuthorDate: Wed May 8 20:08:58 2019 +0900

    Add unit tests for MiniTimelineLabel
---
 .../components/MiniTimeline/MiniTimelineLabel.js   |  6 ++++-
 .../MiniTimeline/MiniTimelineLabel.test.js         | 26 ++++++++++++++++++++++
 2 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/zipkin-lens/src/components/MiniTimeline/MiniTimelineLabel.js b/zipkin-lens/src/components/MiniTimeline/MiniTimelineLabel.js
index ddb402a..d99be17 100644
--- a/zipkin-lens/src/components/MiniTimeline/MiniTimelineLabel.js
+++ b/zipkin-lens/src/components/MiniTimeline/MiniTimelineLabel.js
@@ -26,8 +26,12 @@ const MiniTimelineLabel = ({ numTimeMarkers, duration }) => {
         key={portion}
         className="mini-timeline-label__label-wrapper"
         style={{ left: `${portion * 100}%` }}
+        data-test="label-wrapper"
       >
-        <span className={`mini-timeline-label__label mini-timeline-label__label${modifier}`}>
+        <span
+          className={`mini-timeline-label__label mini-timeline-label__label${modifier}`}
+          data-test="label"
+        >
           {label}
         </span>
       </div>,
diff --git a/zipkin-lens/src/components/MiniTimeline/MiniTimelineLabel.test.js b/zipkin-lens/src/components/MiniTimeline/MiniTimelineLabel.test.js
new file mode 100644
index 0000000..9ab5b52
--- /dev/null
+++ b/zipkin-lens/src/components/MiniTimeline/MiniTimelineLabel.test.js
@@ -0,0 +1,26 @@
+import React from 'react';
+import { shallow } from 'enzyme';
+
+import MiniTimelineLabel from './MiniTimelineLabel';
+
+describe('<MiniTimelineLabel />', () => {
+  it('should set proper positions', () => {
+    const wrapper = shallow(<MiniTimelineLabel numTimeMarkers={5} duration={300} />);
+    const labelWrappers = wrapper.find('[data-test="label-wrapper"]');
+    expect(labelWrappers.at(0).prop('style')).toEqual({ left: '0%' });
+    expect(labelWrappers.at(1).prop('style')).toEqual({ left: '25%' });
+    expect(labelWrappers.at(2).prop('style')).toEqual({ left: '50%' });
+    expect(labelWrappers.at(3).prop('style')).toEqual({ left: '75%' });
+    expect(labelWrappers.at(4).prop('style')).toEqual({ left: '100%' });
+  });
+
+  it('should set proper modifiers', () => {
+    const wrapper = shallow(<MiniTimelineLabel numTimeMarkers={5} duration={300} />);
+    const labelWrappers = wrapper.find('[data-test="label"]');
+    expect(labelWrappers.at(0).hasClass('mini-timeline-label__label--first'));
+    expect(labelWrappers.at(1).hasClass('mini-timeline-label__label--first'));
+    expect(labelWrappers.at(2).hasClass('mini-timeline-label__label--first'));
+    expect(labelWrappers.at(3).hasClass('mini-timeline-label__label--first'));
+    expect(labelWrappers.at(4).hasClass('mini-timeline-label__label--last'));
+  });
+});


[incubator-zipkin] 02/09: Add unit tests for MiniTimeline/util.js

Posted by unknown <""...@apache.org>.
This is an automated email from the ASF dual-hosted git repository.

(unknown) pushed a commit to branch mini-timeline
in repository https://gitbox.apache.org/repos/asf/incubator-zipkin.git

commit a4fdc5ee3c3b20b5e03f306424cee5f80c70fdbb
Author: tacigar <ig...@gmail.com>
AuthorDate: Wed May 8 19:22:27 2019 +0900

    Add unit tests for MiniTimeline/util.js
---
 .../src/components/MiniTimeline/util.test.js       | 28 ++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/zipkin-lens/src/components/MiniTimeline/util.test.js b/zipkin-lens/src/components/MiniTimeline/util.test.js
new file mode 100644
index 0000000..3bbcdc3
--- /dev/null
+++ b/zipkin-lens/src/components/MiniTimeline/util.test.js
@@ -0,0 +1,28 @@
+import { getGraphHeight, getGraphLineHeight } from './util';
+
+describe('getGraphHeight', () => {
+  it('should return proper value', () => {
+    expect(getGraphHeight(-1)).toEqual(0);
+    expect(getGraphHeight(0)).toEqual(0);
+    expect(getGraphHeight(1)).toEqual(0);
+    expect(getGraphHeight(2)).toEqual(2 * 5);
+    expect(getGraphHeight(14)).toEqual(14 * 5);
+    expect(getGraphHeight(15)).toEqual(75);
+    expect(getGraphHeight(16)).toEqual(75);
+    expect(getGraphHeight(100)).toEqual(75);
+  });
+});
+
+describe('getGraphLineHeight', () => {
+  it('should return proper value', () => {
+    expect(getGraphLineHeight(-1)).toEqual(0);
+    expect(getGraphLineHeight(0)).toEqual(0);
+    expect(getGraphLineHeight(1)).toEqual(0);
+    expect(getGraphLineHeight(2)).toEqual(5);
+    expect(getGraphLineHeight(14)).toEqual(5);
+    expect(getGraphLineHeight(15)).toEqual(5);
+    expect(getGraphLineHeight(16)).toEqual(75 / 16);
+    expect(getGraphLineHeight(20)).toEqual(75 / 20);
+    expect(getGraphLineHeight(100)).toEqual(1);
+  });
+});


[incubator-zipkin] 03/09: Add unit tests for MiniTimeline

Posted by unknown <""...@apache.org>.
This is an automated email from the ASF dual-hosted git repository.

(unknown) pushed a commit to branch mini-timeline
in repository https://gitbox.apache.org/repos/asf/incubator-zipkin.git

commit a2acd13f7b93a04f341dced4b62aa7ffc02c94b6
Author: tacigar <ig...@gmail.com>
AuthorDate: Wed May 8 19:48:39 2019 +0900

    Add unit tests for MiniTimeline
---
 .../src/components/MiniTimeline/index.test.js      | 73 ++++++++++++++++++++++
 1 file changed, 73 insertions(+)

diff --git a/zipkin-lens/src/components/MiniTimeline/index.test.js b/zipkin-lens/src/components/MiniTimeline/index.test.js
new file mode 100644
index 0000000..b8da922
--- /dev/null
+++ b/zipkin-lens/src/components/MiniTimeline/index.test.js
@@ -0,0 +1,73 @@
+import React from 'react';
+import { shallow } from 'enzyme';
+
+import MiniTimeline from './index';
+
+describe('<MiniTimeline />', () => {
+  const commonProps = {
+    startTs: 0,
+    endTs: 10,
+    onStartAndEndTsChange: () => {},
+  };
+
+  const dummySpan = {
+    spanId: '1',
+    spanName: 'span',
+    parentId: '2',
+    childIds: [],
+    serviceName: 'service',
+    serviceNames: [],
+    timestamp: 0,
+    duration: 10,
+    durationStr: '10μs',
+    tags: [],
+    annotations: [],
+    errorType: 'none',
+    depth: 1,
+    width: 1,
+    left: 1,
+  };
+
+  it('should return null if the number of spans is less than 2', () => {
+    let props = {
+      ...commonProps,
+      traceSummary: {
+        traceId: '12345',
+        spans: [],
+        serviceNameAndSpanCounts: [],
+        duration: 10,
+        durationStr: '10μs',
+      },
+    };
+    let wrapper = shallow(<MiniTimeline {...props} />);
+    expect(wrapper.type()).toEqual(null);
+
+    props = {
+      ...commonProps,
+      traceSummary: {
+        traceId: '12345',
+        spans: [dummySpan],
+        serviceNameAndSpanCounts: [],
+        duration: 10,
+        durationStr: '10μs',
+      },
+    };
+    wrapper = shallow(<MiniTimeline {...props} />);
+    expect(wrapper.type()).toEqual(null);
+  });
+
+  it('should return mini timeline otherwise', () => {
+    const props = {
+      ...commonProps,
+      traceSummary: {
+        traceId: '12345',
+        spans: [dummySpan, dummySpan],
+        serviceNameAndSpanCounts: [],
+        duration: 10,
+        durationStr: '10μs',
+      },
+    };
+    const wrapper = shallow(<MiniTimeline {...props} />);
+    expect(wrapper.find('.mini-timeline').length).toBe(1);
+  });
+});


[incubator-zipkin] 06/09: Add unit tests for MiniTimelineSlider

Posted by unknown <""...@apache.org>.
This is an automated email from the ASF dual-hosted git repository.

(unknown) pushed a commit to branch mini-timeline
in repository https://gitbox.apache.org/repos/asf/incubator-zipkin.git

commit 6bb92aec6a69a9e5712b7c019b51973485b5a3e8
Author: tacigar <ig...@gmail.com>
AuthorDate: Thu May 9 12:51:29 2019 +0900

    Add unit tests for MiniTimelineSlider
---
 .../MiniTimeline/MiniTimelineSlider.test.js        | 53 ++++++++++++++++++++++
 1 file changed, 53 insertions(+)

diff --git a/zipkin-lens/src/components/MiniTimeline/MiniTimelineSlider.test.js b/zipkin-lens/src/components/MiniTimeline/MiniTimelineSlider.test.js
new file mode 100644
index 0000000..2e9fb25
--- /dev/null
+++ b/zipkin-lens/src/components/MiniTimeline/MiniTimelineSlider.test.js
@@ -0,0 +1,53 @@
+import React from 'react';
+import { shallow } from 'enzyme';
+import Slider from 'rc-slider';
+
+import MiniTimelineSlider from './MiniTimelineSlider';
+
+const { Range } = Slider;
+
+describe('<MiniTimelineSlider />', () => {
+  it('should change isDragging state before changing the range', () => {
+    const wrapper = shallow(
+      <MiniTimelineSlider
+        duration={10}
+        startTs={0}
+        endTs={10}
+        onStartAndEndTsChange={() => {}}
+      />,
+    );
+    wrapper.find(Range).prop('onBeforeChange')();
+    expect(wrapper.state('isDragging')).toEqual(true);
+  });
+
+  it('should change isDragging state after changing the range', () => {
+    const wrapper = shallow(
+      <MiniTimelineSlider
+        duration={10}
+        startTs={0}
+        endTs={10}
+        onStartAndEndTsChange={() => {}}
+      />,
+    );
+    wrapper.find(Range).prop('onBeforeChange')(); // isDragging === true
+    wrapper.find(Range).prop('onAfterChange')([2, 6]);
+    expect(wrapper.state('isDragging')).toEqual(false);
+  });
+
+  it('should call onStartAndEndTsChange after range change', () => {
+    const onStartAndEndTsChange = jest.fn();
+    const wrapper = shallow(
+      <MiniTimelineSlider
+        duration={10}
+        startTs={0}
+        endTs={10}
+        onStartAndEndTsChange={onStartAndEndTsChange}
+      />,
+    );
+    wrapper.find(Range).prop('onAfterChange')([2, 6]);
+    expect(onStartAndEndTsChange).toHaveBeenCalledWith(
+      2 / 10,
+      6 / 10,
+    );
+  });
+});


[incubator-zipkin] 01/09: Add step props to rc-clider range

Posted by unknown <""...@apache.org>.
This is an automated email from the ASF dual-hosted git repository.

(unknown) pushed a commit to branch mini-timeline
in repository https://gitbox.apache.org/repos/asf/incubator-zipkin.git

commit ea6542c45408115a8162b3a28568f1bd1481df4a
Author: tacigar <ig...@gmail.com>
AuthorDate: Wed May 8 19:12:10 2019 +0900

    Add step props to rc-clider range
---
 zipkin-lens/src/components/MiniTimeline/MiniTimelineSlider.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/zipkin-lens/src/components/MiniTimeline/MiniTimelineSlider.js b/zipkin-lens/src/components/MiniTimeline/MiniTimelineSlider.js
index 1a4d862..8d7ec0e 100644
--- a/zipkin-lens/src/components/MiniTimeline/MiniTimelineSlider.js
+++ b/zipkin-lens/src/components/MiniTimeline/MiniTimelineSlider.js
@@ -39,6 +39,7 @@ class MiniTimelineSlider extends React.Component {
     const props = {
       allowCase: false,
       defaultValue: [0, 100],
+      step: 0.01,
       onBeforeChange: this.handleBeforeRangeChange,
       onAfterChange: this.handleAfterRangeChange,
     };
@@ -48,7 +49,6 @@ class MiniTimelineSlider extends React.Component {
         endTs / duration * 100,
       ];
     }
-
     return (
       <div className="mini-timeline-slider">
         <Range {...props} />


[incubator-zipkin] 08/09: Add a simple unit test for MiniTimelineGraph

Posted by unknown <""...@apache.org>.
This is an automated email from the ASF dual-hosted git repository.

(unknown) pushed a commit to branch mini-timeline
in repository https://gitbox.apache.org/repos/asf/incubator-zipkin.git

commit 01e1d0b2372ec702a7dab178169828f718427e56
Author: tacigar <ig...@gmail.com>
AuthorDate: Thu May 9 13:50:23 2019 +0900

    Add a simple unit test for MiniTimelineGraph
---
 .../MiniTimeline/MiniTimelineGraph.test.js          | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/zipkin-lens/src/components/MiniTimeline/MiniTimelineGraph.test.js b/zipkin-lens/src/components/MiniTimeline/MiniTimelineGraph.test.js
new file mode 100644
index 0000000..d082ea7
--- /dev/null
+++ b/zipkin-lens/src/components/MiniTimeline/MiniTimelineGraph.test.js
@@ -0,0 +1,21 @@
+import React from 'react';
+import { shallow } from 'enzyme';
+
+import MiniTimelineGraph from './MiniTimelineGraph';
+
+// TODO: need more tests.
+describe('<MiniTimelineGraph />', () => {
+  it('should be rendered', () => {
+    const wrapper = shallow(
+      <MiniTimelineGraph
+        spans={[]}
+        startTs={0}
+        endTs={10}
+        duration={10}
+        onStartAndEndTsChange={jest.fn()}
+        numTimeMarkers={5}
+      />,
+    );
+    expect(wrapper.find('.mini-timeline-graph').length).toBe(1);
+  });
+});


[incubator-zipkin] 09/09: Updates ui licenses to ASF header

Posted by unknown <""...@apache.org>.
This is an automated email from the ASF dual-hosted git repository.

(unknown) pushed a commit to branch mini-timeline
in repository https://gitbox.apache.org/repos/asf/incubator-zipkin.git

commit a680825271673bf0531dab04eca6a2b9f3b33cca
Author: tacigar <ig...@gmail.com>
AuthorDate: Thu May 9 13:52:21 2019 +0900

    Updates ui licenses to ASF header
---
 .../src/components/MiniTimeline/MiniTimelineGraph.js     | 16 ++++++++++++++++
 .../components/MiniTimeline/MiniTimelineGraph.test.js    | 16 ++++++++++++++++
 .../src/components/MiniTimeline/MiniTimelineLabel.js     | 16 ++++++++++++++++
 .../components/MiniTimeline/MiniTimelineLabel.test.js    | 16 ++++++++++++++++
 .../src/components/MiniTimeline/MiniTimelineSlider.js    | 16 ++++++++++++++++
 .../components/MiniTimeline/MiniTimelineSlider.test.js   | 16 ++++++++++++++++
 .../components/MiniTimeline/MiniTimelineTimeMarkers.js   | 16 ++++++++++++++++
 .../MiniTimeline/MiniTimelineTimeMarkers.test.js         | 16 ++++++++++++++++
 zipkin-lens/src/components/MiniTimeline/index.js         | 16 ++++++++++++++++
 zipkin-lens/src/components/MiniTimeline/index.test.js    | 16 ++++++++++++++++
 zipkin-lens/src/components/MiniTimeline/util.js          | 16 ++++++++++++++++
 zipkin-lens/src/components/MiniTimeline/util.test.js     | 16 ++++++++++++++++
 12 files changed, 192 insertions(+)

diff --git a/zipkin-lens/src/components/MiniTimeline/MiniTimelineGraph.js b/zipkin-lens/src/components/MiniTimeline/MiniTimelineGraph.js
index 8c2c0d3..6e68b5f 100644
--- a/zipkin-lens/src/components/MiniTimeline/MiniTimelineGraph.js
+++ b/zipkin-lens/src/components/MiniTimeline/MiniTimelineGraph.js
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 import PropTypes from 'prop-types';
 import React from 'react';
 
diff --git a/zipkin-lens/src/components/MiniTimeline/MiniTimelineGraph.test.js b/zipkin-lens/src/components/MiniTimeline/MiniTimelineGraph.test.js
index d082ea7..390f55f 100644
--- a/zipkin-lens/src/components/MiniTimeline/MiniTimelineGraph.test.js
+++ b/zipkin-lens/src/components/MiniTimeline/MiniTimelineGraph.test.js
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 import React from 'react';
 import { shallow } from 'enzyme';
 
diff --git a/zipkin-lens/src/components/MiniTimeline/MiniTimelineLabel.js b/zipkin-lens/src/components/MiniTimeline/MiniTimelineLabel.js
index d99be17..8ec3244 100644
--- a/zipkin-lens/src/components/MiniTimeline/MiniTimelineLabel.js
+++ b/zipkin-lens/src/components/MiniTimeline/MiniTimelineLabel.js
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 import PropTypes from 'prop-types';
 import React from 'react';
 
diff --git a/zipkin-lens/src/components/MiniTimeline/MiniTimelineLabel.test.js b/zipkin-lens/src/components/MiniTimeline/MiniTimelineLabel.test.js
index 9ab5b52..0e5f97c 100644
--- a/zipkin-lens/src/components/MiniTimeline/MiniTimelineLabel.test.js
+++ b/zipkin-lens/src/components/MiniTimeline/MiniTimelineLabel.test.js
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 import React from 'react';
 import { shallow } from 'enzyme';
 
diff --git a/zipkin-lens/src/components/MiniTimeline/MiniTimelineSlider.js b/zipkin-lens/src/components/MiniTimeline/MiniTimelineSlider.js
index 8d7ec0e..8542c5b 100644
--- a/zipkin-lens/src/components/MiniTimeline/MiniTimelineSlider.js
+++ b/zipkin-lens/src/components/MiniTimeline/MiniTimelineSlider.js
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 import PropTypes from 'prop-types';
 import React from 'react';
 import Slider from 'rc-slider';
diff --git a/zipkin-lens/src/components/MiniTimeline/MiniTimelineSlider.test.js b/zipkin-lens/src/components/MiniTimeline/MiniTimelineSlider.test.js
index 2e9fb25..d4921ac 100644
--- a/zipkin-lens/src/components/MiniTimeline/MiniTimelineSlider.test.js
+++ b/zipkin-lens/src/components/MiniTimeline/MiniTimelineSlider.test.js
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 import React from 'react';
 import { shallow } from 'enzyme';
 import Slider from 'rc-slider';
diff --git a/zipkin-lens/src/components/MiniTimeline/MiniTimelineTimeMarkers.js b/zipkin-lens/src/components/MiniTimeline/MiniTimelineTimeMarkers.js
index 4c1ba76..b2656d7 100644
--- a/zipkin-lens/src/components/MiniTimeline/MiniTimelineTimeMarkers.js
+++ b/zipkin-lens/src/components/MiniTimeline/MiniTimelineTimeMarkers.js
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 import PropTypes from 'prop-types';
 import React from 'react';
 
diff --git a/zipkin-lens/src/components/MiniTimeline/MiniTimelineTimeMarkers.test.js b/zipkin-lens/src/components/MiniTimeline/MiniTimelineTimeMarkers.test.js
index cefb995..78b9b84 100644
--- a/zipkin-lens/src/components/MiniTimeline/MiniTimelineTimeMarkers.test.js
+++ b/zipkin-lens/src/components/MiniTimeline/MiniTimelineTimeMarkers.test.js
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 import React from 'react';
 import { shallow } from 'enzyme';
 
diff --git a/zipkin-lens/src/components/MiniTimeline/index.js b/zipkin-lens/src/components/MiniTimeline/index.js
index ca12147..d85435b 100644
--- a/zipkin-lens/src/components/MiniTimeline/index.js
+++ b/zipkin-lens/src/components/MiniTimeline/index.js
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 import PropTypes from 'prop-types';
 import React from 'react';
 
diff --git a/zipkin-lens/src/components/MiniTimeline/index.test.js b/zipkin-lens/src/components/MiniTimeline/index.test.js
index b8da922..1139bdf 100644
--- a/zipkin-lens/src/components/MiniTimeline/index.test.js
+++ b/zipkin-lens/src/components/MiniTimeline/index.test.js
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 import React from 'react';
 import { shallow } from 'enzyme';
 
diff --git a/zipkin-lens/src/components/MiniTimeline/util.js b/zipkin-lens/src/components/MiniTimeline/util.js
index ab3b57a..847c851 100644
--- a/zipkin-lens/src/components/MiniTimeline/util.js
+++ b/zipkin-lens/src/components/MiniTimeline/util.js
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 export const getGraphHeight = (numSpans) => {
   if (numSpans <= 1) {
     return 0;
diff --git a/zipkin-lens/src/components/MiniTimeline/util.test.js b/zipkin-lens/src/components/MiniTimeline/util.test.js
index 3bbcdc3..bd1423e 100644
--- a/zipkin-lens/src/components/MiniTimeline/util.test.js
+++ b/zipkin-lens/src/components/MiniTimeline/util.test.js
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 import { getGraphHeight, getGraphLineHeight } from './util';
 
 describe('getGraphHeight', () => {


[incubator-zipkin] 05/09: Add unit tests for MiniTimelineTimeMarker

Posted by unknown <""...@apache.org>.
This is an automated email from the ASF dual-hosted git repository.

(unknown) pushed a commit to branch mini-timeline
in repository https://gitbox.apache.org/repos/asf/incubator-zipkin.git

commit 36a72d0129680304297d424b4573e2d91854afdc
Author: tacigar <ig...@gmail.com>
AuthorDate: Wed May 8 20:18:46 2019 +0900

    Add unit tests for MiniTimelineTimeMarker
---
 .../src/components/MiniTimeline/MiniTimelineGraph.js       |  4 ++--
 .../{MiniTimelineMarkers.js => MiniTimelineTimeMarkers.js} |  0
 .../MiniTimeline/MiniTimelineTimeMarkers.test.js           | 14 ++++++++++++++
 3 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/zipkin-lens/src/components/MiniTimeline/MiniTimelineGraph.js b/zipkin-lens/src/components/MiniTimeline/MiniTimelineGraph.js
index 5f4327b..8c2c0d3 100644
--- a/zipkin-lens/src/components/MiniTimeline/MiniTimelineGraph.js
+++ b/zipkin-lens/src/components/MiniTimeline/MiniTimelineGraph.js
@@ -1,7 +1,7 @@
 import PropTypes from 'prop-types';
 import React from 'react';
 
-import MiniTimelineMarkers from './MiniTimelineMarkers';
+import MiniTimelineTimeMarkers from './MiniTimelineTimeMarkers';
 import { getGraphHeight, getGraphLineHeight } from './util';
 import { getServiceNameColor } from '../../util/color';
 import { detailedSpansPropTypes } from '../../prop-types';
@@ -91,7 +91,7 @@ class MiniTimelineGraph extends React.Component {
         onMouseDown={this.handleMouseDown}
       >
         <svg version="1.1" width="100%" height={graphHeight} xmlns="http://www.w3.org/2000/svg">
-          <MiniTimelineMarkers
+          <MiniTimelineTimeMarkers
             height={graphHeight}
             numTimeMarkers={numTimeMarkers}
           />
diff --git a/zipkin-lens/src/components/MiniTimeline/MiniTimelineMarkers.js b/zipkin-lens/src/components/MiniTimeline/MiniTimelineTimeMarkers.js
similarity index 100%
rename from zipkin-lens/src/components/MiniTimeline/MiniTimelineMarkers.js
rename to zipkin-lens/src/components/MiniTimeline/MiniTimelineTimeMarkers.js
diff --git a/zipkin-lens/src/components/MiniTimeline/MiniTimelineTimeMarkers.test.js b/zipkin-lens/src/components/MiniTimeline/MiniTimelineTimeMarkers.test.js
new file mode 100644
index 0000000..cefb995
--- /dev/null
+++ b/zipkin-lens/src/components/MiniTimeline/MiniTimelineTimeMarkers.test.js
@@ -0,0 +1,14 @@
+import React from 'react';
+import { shallow } from 'enzyme';
+
+import MiniTimelineTimeMarkers from './MiniTimelineTimeMarkers';
+
+describe('<MiniTimelineTimeMarkers />', () => {
+  it('should set proper positions', () => {
+    const wrapper = shallow(<MiniTimelineTimeMarkers height={75} numTimeMarkers={5} />);
+    const timeMarkers = wrapper.find('line');
+    expect(timeMarkers.at(0).prop('x1')).toEqual('25%');
+    expect(timeMarkers.at(1).prop('x1')).toEqual('50%');
+    expect(timeMarkers.at(2).prop('x1')).toEqual('75%');
+  });
+});