Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
key={cellIndex}
linked
onToggle={this._handleToggleAllArtifacts}
style={cellStyles && [...cellStyles, styles.stickyColumnStickyHeader]}
/>
);
case CellType.TEXT:
return (
);
case CellType.TOTAL_DELTA:
case CellType.DELTA: {
// $FlowFixMe
const deltaCell = (cell: BT$DeltaCellType);
return (
);
}
case CellType.TOTAL: {
switch (cell && cell.type) {
case CellType.ARTIFACT:
return (
);
case CellType.DELTA: {
// $FlowFixMe
const deltaCell = (cell: BT$DeltaCellType);
return (
);
}
case CellType.TOTAL: {
// $FlowFixMe
// $FlowFixMe
const deltaCell = (cell: BT$DeltaCellType);
return (
);
}
case CellType.TOTAL: {
// $FlowFixMe
const totalCell = (cell: BT$TotalCellType);
return (
);
}
default:
return null;
}
case CellType.DELTA: {
// $FlowFixMe
const deltaCell = (cell: BT$DeltaCellType);
return (
);
}
case CellType.TOTAL: {
// $FlowFixMe
const totalCell = (cell: BT$TotalCellType);
return (
);
}
default:
return null;
_renderCell = (cell: BT$BodyCellType, columnIndex: number, artifactName: string, isHovered: boolean) => {
const { color, isActive, onCellClick, onToggleArtifact, valueType } = this.props;
const hoverColor = hsl(color);
hoverColor.s = 0.7;
hoverColor.l = 0.95;
switch (cell && cell.type) {
case CellType.ARTIFACT:
return (
);
case CellType.DELTA: {
// $FlowFixMe
const deltaCell = (cell: BT$DeltaCellType);
return (
_renderTotalCell = (
cell: BT$BodyCellType,
cellIndex: number,
rowIndex?: number,
cellText?: string,
style?: mixed
) => {
const { activeArtifactNames, artifactNames, valueType } = this.props;
// $FlowFixMe
const text = cellText || (cell.hasOwnProperty('text') ? cell.text : '');
const cellStyles = rowIndex ? [styles.header, { top: getHeaderTopPos(rowIndex) }, style] : undefined;
switch (cell.type) {
case CellType.ARTIFACT:
return (
);
case CellType.TEXT:
return (
color={theme.colorMidnight}
key={cellIndex}
linked
onToggle={this._handleToggleAllArtifacts}
style={cellStyles && [...cellStyles, styles.stickyColumnStickyHeader]}
/>
);
case CellType.TEXT:
return (
);
case CellType.TOTAL_DELTA:
case CellType.DELTA: {
// $FlowFixMe
const deltaCell = (cell: BT$DeltaCellType);
return (
);
}
_renderHeaderCell = (cell: BT$HeaderCellType, cellIndex: number) => {
const { onRemoveBuild, onShowBuildInfo } = this.props;
switch (cell.type) {
case CellType.REVISION_HEADER:
// $FlowFixMe
return (
);
case CellType.REVISION_DELTA_HEADER:
// $FlowFixMe
return ;
default:
return ;
}
};
_renderHeaderCell = (cell: BT$HeaderCellType, cellIndex: number) => {
const { onRemoveBuild, onShowBuildInfo } = this.props;
switch (cell.type) {
case CellType.REVISION_HEADER:
// $FlowFixMe
return (
);
case CellType.REVISION_DELTA_HEADER:
// $FlowFixMe
return ;
default:
return ;
}
};
test('shows formatted bytes and delta in the title', () => {
const wrapper = shallow(
);
expect(wrapper.find(Td).prop('title')).toEqual('-134 bytes (-50.0%)');
});