Skip to content

Commit

Permalink
[TSVB] Add more functional tests for Gauge and TopN (#105361)
Browse files Browse the repository at this point in the history
* [TSVB] Add more functional tests for Gauge and TopN

* Update visual_builder_page.ts

* Update functions related to gauge color and filter ratio numerator in visual_builder_page

* Update visual_builder_page and add some more test subjects

* Update _tsvb_chart.ts

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
DianaDerevyankina and kibanamachine authored Jul 21, 2021
1 parent 218c9c2 commit 2e0fdda
Show file tree
Hide file tree
Showing 5 changed files with 248 additions and 110 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,15 @@ export class Gauge extends Component {
ref={(el) => (this.inner = el)}
style={styles.inner}
>
<div className="tvbVisGauge__label" ref="title">
<div className="tvbVisGauge__label" ref="title" data-test-subj="gaugeLabel">
{title}
</div>
<div className="tvbVisGauge__value" style={styles.valueColor} ref="label">
<div
className="tvbVisGauge__value"
style={styles.valueColor}
ref="label"
data-test-subj="gaugeValue"
>
{formatter(value)}
</div>
{additionalLabel}
Expand All @@ -124,10 +129,15 @@ export class Gauge extends Component {
ref={(el) => (this.inner = el)}
style={styles.inner}
>
<div className="tvbVisGauge__value" style={styles.valueColor} ref="label">
<div
className="tvbVisGauge__value"
style={styles.valueColor}
ref="label"
data-test-subj="gaugeValue"
>
{formatter(value)}
</div>
<div className="tvbVisGauge__label" ref="title">
<div className="tvbVisGauge__label" ref="title" data-test-subj="gaugeLabel">
{title}
</div>
{additionalLabel}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,19 @@ export class GaugeVis extends Component {
if (type === 'half') {
svg = (
<svg width={120.72} height={78.72}>
<circle {...props.circleBackground} style={styles.innerLine} />
<circle {...props.circle} style={styles.gaugeLine} />
<circle
{...props.circleBackground}
style={styles.innerLine}
data-test-subj="gaugeCircleInner"
/>
<circle {...props.circle} style={styles.gaugeLine} data-test-subj="gaugeCircle" />
</svg>
);
} else {
svg = (
<svg width={120.72} height={120.72}>
<circle {...props.circleBackground} />
<circle {...props.circle} />
<circle {...props.circleBackground} data-test-subj="gaugeCircleInner" />
<circle {...props.circle} data-test-subj="gaugeCircle" />
</svg>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export class TopN extends Component {
</td>
<td width="100%" className="tvbVisTopN__bar">
<div className="tvbVisTopN__innerBar" style={styles.innerBar}>
<div style={styles.innerBarValue} />
<div style={styles.innerBarValue} data-test-subj="topNInnerBar" />
</div>
</td>
<td className="tvbVisTopN__value" data-test-subj="tsvbTopNValue">
Expand Down
Loading

0 comments on commit 2e0fdda

Please sign in to comment.