Skip to content

Commit

Permalink
Merge pull request #1 from everett980/issue-239-fix-TracePageHeader-t…
Browse files Browse the repository at this point in the history
…ests-once-new-version-of-enzyme-is-released

Update enzyme, Re-enable and add TraceDiff and TracePage tests
  • Loading branch information
everett980 committed Mar 8, 2019
2 parents c3d4d14 + b4afe2d commit de6571f
Show file tree
Hide file tree
Showing 26 changed files with 3,731 additions and 175 deletions.
4 changes: 2 additions & 2 deletions packages/jaeger-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"babel-plugin-import": "1.11.0",
"bluebird": "^3.5.0",
"customize-cra": "0.2.9",
"enzyme": "^3.2.0",
"enzyme-adapter-react-16": "^1.1.0",
"enzyme": "^3.8.0",
"enzyme-adapter-react-16": "^1.2.0",
"enzyme-to-json": "^3.3.0",
"http-proxy-middleware": "^0.19.1",
"less": "3.9.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,23 @@ exports[`DiffSelection renders a trace as expected 1`] = `
<div
className="DiffSelection--message"
>
<React.Fragment>
<Button
block={false}
className="ub-right"
disabled={true}
ghost={false}
loading={false}
prefixCls="ant-btn"
type="primary"
>
Compare Traces
</Button>
<h2
className="ub-m0"
>
1
Selected for comparison
</h2>
</React.Fragment>
<Button
block={false}
className="ub-right"
disabled={true}
ghost={false}
loading={false}
prefixCls="ant-btn"
type="primary"
>
Compare Traces
</Button>
<h2
className="ub-m0"
>
1
Selected for comparison
</h2>
</div>
</div>
`;
Expand Down Expand Up @@ -97,30 +95,28 @@ exports[`DiffSelection renders multiple traces as expected 1`] = `
<div
className="DiffSelection--message"
>
<React.Fragment>
<Link
replace={false}
to="/trace/trace-id-0...trace-id-1?cohort=trace-id-0&cohort=trace-id-1"
>
<Button
block={false}
className="ub-right"
disabled={false}
ghost={false}
loading={false}
prefixCls="ant-btn"
type="primary"
>
Compare Traces
</Button>
</Link>
<h2
className="ub-m0"
<Link
replace={false}
to="/trace/trace-id-0...trace-id-1?cohort=trace-id-0&cohort=trace-id-1"
>
<Button
block={false}
className="ub-right"
disabled={false}
ghost={false}
loading={false}
prefixCls="ant-btn"
type="primary"
>
2
Selected for comparison
</h2>
</React.Fragment>
Compare Traces
</Button>
</Link>
<h2
className="ub-m0"
>
2
Selected for comparison
</h2>
</div>
</div>
`;
16 changes: 8 additions & 8 deletions packages/jaeger-ui/src/components/TraceDiff/TraceDiff.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,22 @@ type State = {
graphTopOffset: number,
};

function syncStates(urlSt, reduxSt, forceState) {
const { a: urlA, b: urlB } = urlSt;
const { a: reduxA, b: reduxB } = reduxSt;
function syncStates(urlValues, reduxValues, forceState) {
const { a: urlA, b: urlB } = urlValues;
const { a: reduxA, b: reduxB } = reduxValues;
if (urlA !== reduxA || urlB !== reduxB) {
forceState(urlSt);
forceState(urlValues);
return;
}
const urlCohort = new Set(urlSt.cohort || []);
const reduxCohort = new Set(reduxSt.cohort || []);
const urlCohort = new Set(urlValues.cohort);
const reduxCohort = new Set(reduxValues.cohort || []);
if (urlCohort.size !== reduxCohort.size) {
forceState(urlSt);
forceState(urlValues);
return;
}
const needSync = Array.from(urlCohort).some(id => !reduxCohort.has(id));
if (needSync) {
forceState(urlSt);
forceState(urlValues);
}
}

Expand Down
Loading

0 comments on commit de6571f

Please sign in to comment.