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