mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-27 19:48:12 +08:00
Better smoke tests (#669)
This commit is contained in:
@@ -342,7 +342,7 @@ class HistogramBrush extends React.Component {
|
||||
.select(svgRef)
|
||||
.append("g")
|
||||
.attr("class", "brush")
|
||||
.attr("data-testid", `${svgRef.id}-brush`)
|
||||
.attr("data-testid", `${svgRef.dataset.testid}-brush`)
|
||||
.call(brushX);
|
||||
|
||||
/* AXIS */
|
||||
@@ -380,12 +380,18 @@ class HistogramBrush extends React.Component {
|
||||
scatterplotYYaccessor,
|
||||
zebra
|
||||
} = this.props;
|
||||
|
||||
const field_for_id = field.replace(/\s/g, "_");
|
||||
return (
|
||||
<div
|
||||
id={`histogram_${field}`}
|
||||
id={`histogram_${field_for_id}`}
|
||||
data-testid={`histogram-${field}`}
|
||||
data-testclass={isDiffExp ? `histogram-diffexp` : ""}
|
||||
data-testclass={
|
||||
isDiffExp
|
||||
? "histogram-diffexp"
|
||||
: isUserDefined
|
||||
? "histogram-user-gene"
|
||||
: "histogram-continuous-metadata"
|
||||
}
|
||||
style={{
|
||||
padding: globals.leftSidebarSectionPadding,
|
||||
backgroundColor: zebra ? globals.lightestGrey : "white"
|
||||
@@ -400,6 +406,7 @@ class HistogramBrush extends React.Component {
|
||||
/>
|
||||
<ButtonGroup style={{ marginRight: 7 }}>
|
||||
<Button
|
||||
data-testid={`plot-x-${field}`}
|
||||
onClick={this.handleSetGeneAsScatterplotX(field).bind(this)}
|
||||
active={scatterplotXXaccessor === field}
|
||||
intent={scatterplotXXaccessor === field ? "primary" : "none"}
|
||||
@@ -407,6 +414,7 @@ class HistogramBrush extends React.Component {
|
||||
plot x
|
||||
</Button>
|
||||
<Button
|
||||
data-testid={`plot-y-${field}`}
|
||||
onClick={this.handleSetGeneAsScatterplotY(field).bind(this)}
|
||||
active={scatterplotYYaccessor === field}
|
||||
intent={scatterplotYYaccessor === field ? "primary" : "none"}
|
||||
@@ -434,6 +442,8 @@ class HistogramBrush extends React.Component {
|
||||
onClick={this.handleColorAction.bind(this)}
|
||||
active={colorAccessor === field}
|
||||
intent={colorAccessor === field ? "primary" : "none"}
|
||||
data-testclass="colorby"
|
||||
data-testid={`colorby-${field}`}
|
||||
icon="tint"
|
||||
/>
|
||||
</Tooltip>
|
||||
@@ -441,9 +451,9 @@ class HistogramBrush extends React.Component {
|
||||
<svg
|
||||
width={this.width}
|
||||
height={this.height}
|
||||
id={`histogram_${field}_svg`}
|
||||
data-testclass="histogram-svg"
|
||||
data-testid={`histogram_${field}_svg`}
|
||||
id={`histogram_${field_for_id}_svg`}
|
||||
data-testclass="histogram-plot"
|
||||
data-testid={`histogram-${field}-plot`}
|
||||
ref={svgRef => {
|
||||
this.drawHistogram(svgRef);
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user