All files / components/Commons CommonsSelect.js

100% Statements 3/3
100% Branches 1/1
100% Functions 3/3
100% Lines 3/3

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26      156x             434x         7x                    
import {Form} from "react-bootstrap";
 
function CommonsSelect({commons, handleCommonsSelection, selectedCommons, testid="CommonsSelect"}) {
  return (
    <Form.Group className="mb-3" >
        <Form.Text htmlFor="commons" className="fw-bold fs-5">
          Commons
        </Form.Text>
        <div className="ms-3" data-testid={`${testid}-CommonsSelect-div`}>
          {commons.map((object) => (
            <Form.Check
              key={object.id}
              type="radio"
              label={object.name}
              data-testid={`${testid}-commons-${object.id}`}
              onChange={() => handleCommonsSelection(object.id, object.name)}
              checked={selectedCommons === object.id}
            />
          ))}
        </div>
      </Form.Group>
  );
}
 
export default CommonsSelect;