import React__default from 'react';
import { cleanup, render, screen } from '@testing-library/react';
import '@testing-library/jest-dom/extend-expect';
import Button from '../index.js';
import ButtonGroup from '../button-group.js';
import '../../defineProperty-CEd-kZQW.js';
import '../../extends-C4cduGrv.js';
import '../../objectWithoutProperties-TXwlfNxG.js';
import 'prop-types';
import '@reach/visually-hidden';
import '../../ck-icon/index.js';
import 'classnames';
import '../../ck-icon/assets/icon-map/index.js';
import '../../icon/index.js';
import '@fortawesome/react-fontawesome';
import '../../icon/icons.js';
import '../../icon/library.js';
import '@fortawesome/fontawesome-svg-core';
import '@fortawesome/pro-solid-svg-icons';
import '@fortawesome/pro-light-svg-icons';
import '@fortawesome/free-brands-svg-icons';
import '../../slicedToArray-BB-AwwkK.js';

afterEach(cleanup);
describe("ButtonGroup", function () {
  it("defaults `spacing` to 1", function () {
    render( /*#__PURE__*/React__default.createElement(ButtonGroup, null, /*#__PURE__*/React__default.createElement(Button, null, "One"), /*#__PURE__*/React__default.createElement(Button, null, "Two")));
    var group = screen.getByTestId("btn-group");
    expect(group.className).toContain("gap-1");
    expect(group.className).toContain("p-1");
  });
  it("can set spacing via prop", function () {
    render( /*#__PURE__*/React__default.createElement(ButtonGroup, {
      spacing: 4
    }, /*#__PURE__*/React__default.createElement(Button, null, "One"), /*#__PURE__*/React__default.createElement(Button, null, "Two")));
    var group = screen.getByTestId("btn-group");
    expect(group.className).toContain("gap-4");
    expect(group.className).toContain("p-4");
  });
  it("doesnt override existing classes", function () {
    render( /*#__PURE__*/React__default.createElement(ButtonGroup, null, /*#__PURE__*/React__default.createElement(Button, null, "One"), /*#__PURE__*/React__default.createElement(Button, {
      className: "button-two"
    }, "Two")));
    var two = screen.getByRole("button", {
      name: "Two"
    });
    expect(two.classList).toContain("button-two");
  });
});
