Sha256: 45f0591c100c611edfd7c330d9390768350aa240469b4e55c22bae7d7d039819

Contents?: true

Size: 1.84 KB

Versions: 375

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

375 entries across 375 versions & 1 rubygems

Version Path
playbook_ui-14.11.0.pre.rc.17 app/pb_kits/playbook/pb_home_address_street/home_adress_street.test.js
playbook_ui-14.11.0 app/pb_kits/playbook/pb_home_address_street/home_adress_street.test.js
playbook_ui-14.11.0.pre.rc.16 app/pb_kits/playbook/pb_home_address_street/home_adress_street.test.js
playbook_ui-14.10.0.pre.alpha.play16825301 app/pb_kits/playbook/pb_home_address_street/home_adress_street.test.js
playbook_ui-14.11.0.pre.rc.15 app/pb_kits/playbook/pb_home_address_street/home_adress_street.test.js
playbook_ui-14.11.0.pre.rc.14 app/pb_kits/playbook/pb_home_address_street/home_adress_street.test.js
playbook_ui-14.11.0.pre.rc.13 app/pb_kits/playbook/pb_home_address_street/home_adress_street.test.js
playbook_ui-14.11.0.pre.rc.12 app/pb_kits/playbook/pb_home_address_street/home_adress_street.test.js
playbook_ui-14.10.0.pre.alpha.PLAY1774timelinelabelstepspacing5274 app/pb_kits/playbook/pb_home_address_street/home_adress_street.test.js
playbook_ui-14.10.0.pre.alpha.play1465attempt25272 app/pb_kits/playbook/pb_home_address_street/home_adress_street.test.js
playbook_ui-14.10.0.pre.alpha.play16825244 app/pb_kits/playbook/pb_home_address_street/home_adress_street.test.js
playbook_ui-14.11.0.pre.rc.11 app/pb_kits/playbook/pb_home_address_street/home_adress_street.test.js
playbook_ui-14.11.0.pre.rc.10 app/pb_kits/playbook/pb_home_address_street/home_adress_street.test.js
playbook_ui-14.10.0.pre.alpha.play1662cssbargraph5214 app/pb_kits/playbook/pb_home_address_street/home_adress_street.test.js
playbook_ui-14.10.0.pre.alpha.play1662cssbargraph5213 app/pb_kits/playbook/pb_home_address_street/home_adress_street.test.js
playbook_ui-14.10.0.pre.alpha.play1662cssbargraph5210 app/pb_kits/playbook/pb_home_address_street/home_adress_street.test.js
playbook_ui-14.10.0.pre.alpha.play1662cssbargraph5208 app/pb_kits/playbook/pb_home_address_street/home_adress_street.test.js
playbook_ui-14.10.0.pre.alpha.play1662cssbargraph5207 app/pb_kits/playbook/pb_home_address_street/home_adress_street.test.js
playbook_ui-14.10.0.pre.alpha.play16825206 app/pb_kits/playbook/pb_home_address_street/home_adress_street.test.js
playbook_ui-14.10.0.pre.alpha.play1662cssbargraph5204 app/pb_kits/playbook/pb_home_address_street/home_adress_street.test.js