Sha256: 17828f392b59d6398f734272e7f5b35bf95fae1ac16d43f73200d583a06a1d07

Contents?: true

Size: 1.84 KB

Versions: 107

Compression:

Stored size: 1.84 KB

Contents

import React from 'react'
import { render, screen, cleanup } from "../utilities/test-utils";

import { HomeAddressStreet } from "playbook-ui";


const testId = "primary-test"
const address = "70 Prospect Ave"
const city = "West Chester"
const homeId = "8250263"

function HomeAdressStreetTest(props) {
    return (
        <HomeAddressStreet
            address={address}
            addressCont="Apt M18"
            city={city}
            data={{ testid: testId }}
            homeId={homeId}
            homeUrl="https://powerhrg.com/"
            houseStyle="Colonial"
            state="PA"
            territory="PHL"
            zipcode="19382"
            {...props}
    />
    );
  }
  
  test("renders the component", () => {
    render(<HomeAdressStreetTest />);
    const kit = screen.getByTestId("primary-test");
    expect(kit).toBeInTheDocument();
    expect(kit).toHaveClass("pb_home_address_street");

    cleanup()
  });

  test("emphasize street by not setting a prop", () => {
    const { container } = render(<HomeAdressStreetTest />);
    expect(container.getElementsByClassName("pb_title_kit_size_4 pb_home_address_street_address")[0]).toHaveTextContent(address);

    cleanup()
  });

  test("emphasize city", () => {
    const { container } = render(<HomeAdressStreetTest emphasis="city" />);
    expect(container.getElementsByClassName("pb_title_kit_size_4 pb_home_address_street_address")[0]).toHaveTextContent(city);

    cleanup()
  });

  test("renders the hashtag kit", () => {
    const { container } = render(<HomeAdressStreetTest />);
    expect(container.getElementsByClassName("pb_hashtag_kit")[0]).toBeInTheDocument;
    expect(container.getElementsByClassName("pb_hashtag_kit")[0].firstChild).toHaveAttribute("href");
    expect(container.getElementsByClassName("pb_hashtag_kit")[0].firstChild).toHaveTextContent(homeId);

    cleanup()
  });

Version data entries

107 entries across 107 versions & 1 rubygems

Version Path
playbook_ui-14.3.0.pre.rc.8 app/pb_kits/playbook/pb_home_address_street/home_adress_street.test.js
playbook_ui-14.3.0.pre.rc.7 app/pb_kits/playbook/pb_home_address_street/home_adress_street.test.js
playbook_ui-14.3.0.pre.rc.6 app/pb_kits/playbook/pb_home_address_street/home_adress_street.test.js
playbook_ui-14.3.0.pre.rc.5 app/pb_kits/playbook/pb_home_address_street/home_adress_street.test.js
playbook_ui-14.3.0.pre.rc.4 app/pb_kits/playbook/pb_home_address_street/home_adress_street.test.js
playbook_ui-14.2.1.pre.alpha.20240828cikubedbump3702 app/pb_kits/playbook/pb_home_address_street/home_adress_street.test.js
playbook_ui-14.3.0.pre.rc.3 app/pb_kits/playbook/pb_home_address_street/home_adress_street.test.js
playbook_ui-14.2.1.pre.alpha.PBNTR431fixingduplicatingtextareaclassname3689 app/pb_kits/playbook/pb_home_address_street/home_adress_street.test.js
playbook_ui-14.3.0.pre.rc.2 app/pb_kits/playbook/pb_home_address_street/home_adress_street.test.js
playbook_ui-14.2.1.pre.alpha.PLAY1516railsiconsfixedwidth3674 app/pb_kits/playbook/pb_home_address_street/home_adress_street.test.js
playbook_ui-14.2.1.pre.alpha.PBNTR479removeextraspacingfromradiochildren3671 app/pb_kits/playbook/pb_home_address_street/home_adress_street.test.js
playbook_ui-14.3.0.pre.rc.1 app/pb_kits/playbook/pb_home_address_street/home_adress_street.test.js
playbook_ui-14.2.1.pre.alpha.PBNTR479removeextraspacingfromradiochildren3669 app/pb_kits/playbook/pb_home_address_street/home_adress_street.test.js
playbook_ui-14.2.1.pre.alpha.pbntr373enablekitsforradio3665 app/pb_kits/playbook/pb_home_address_street/home_adress_street.test.js
playbook_ui-14.2.1.pre.alpha.bugfixforactionrc3663 app/pb_kits/playbook/pb_home_address_street/home_adress_street.test.js
playbook_ui-14.2.0.pre.alpha.PLAY15063653 app/pb_kits/playbook/pb_home_address_street/home_adress_street.test.js
playbook_ui-14.2.0.pre.alpha.play1490railsdialogdatafix3649 app/pb_kits/playbook/pb_home_address_street/home_adress_street.test.js
playbook_ui-14.2.0.pre.alpha.PLAY15063645 app/pb_kits/playbook/pb_home_address_street/home_adress_street.test.js
playbook_ui-14.2.1 app/pb_kits/playbook/pb_home_address_street/home_adress_street.test.js
playbook_ui-14.2.0.pre.alpha.PLAY15063640 app/pb_kits/playbook/pb_home_address_street/home_adress_street.test.js