mirror of
https://github.com/BorysLevytskyi/BitwiseCmd.git
synced 2025-12-10 06:52:05 +01:00
Add class names for integration tests
This commit is contained in:
@@ -5,18 +5,19 @@ export type BinaryStringViewProps = {
|
||||
binaryString: string;
|
||||
onFlipBit?: (input: FlipBitEventArg) => void;
|
||||
emphasizeBytes: boolean;
|
||||
className?:string
|
||||
};
|
||||
|
||||
export type FlipBitEventArg = {
|
||||
index: number;
|
||||
binaryString: string;
|
||||
$event: any;
|
||||
newBinaryString: string
|
||||
newBinaryString: string,
|
||||
};
|
||||
|
||||
export default class BinaryStringView extends React.Component<BinaryStringViewProps> {
|
||||
render() {
|
||||
return <span>{this.getChildren()}</span>
|
||||
return <span className={this.props.className}>{this.getChildren()}</span>
|
||||
}
|
||||
|
||||
onBitClick(index: number, e : any) {
|
||||
|
||||
@@ -21,9 +21,12 @@ export class IpAddressView extends React.Component<IpAddressViewProps>
|
||||
return <table className="expression">
|
||||
<tbody>
|
||||
{this.props.ipAddresses.map((ip, i) => <tr key={i}>
|
||||
<td><strong>{ip.toString()}</strong></td>
|
||||
<td className="label"><strong>{ip.toString()}</strong></td>
|
||||
<td>
|
||||
{this.bin(ip.firstByte, 1, ip)}.{this.bin(ip.secondByte, 2, ip)}.{this.bin(ip.thirdByte, 3, ip)}.{this.bin(ip.fourthByte, 4, ip)}
|
||||
{this.bin(ip.firstByte, 1, ip)}<span className="soft">.</span>
|
||||
{this.bin(ip.secondByte, 2, ip)}<span className="soft">.</span>
|
||||
{this.bin(ip.thirdByte, 3, ip)}<span className="soft">.</span>
|
||||
{this.bin(ip.fourthByte, 4, ip)}
|
||||
</td>
|
||||
</tr>)}
|
||||
</tbody>
|
||||
@@ -62,6 +65,7 @@ export class IpAddressView extends React.Component<IpAddressViewProps>
|
||||
key={octetNumber}
|
||||
emphasizeBytes={false}
|
||||
allowFlipBits={true}
|
||||
className={`octet-${octetNumber}`}
|
||||
onFlipBit={e => this.onFlippedBit(e.newBinaryString, octetNumber, ip)} />;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user