Sha256: 028f2b39e5d971a0cecc69e32824bfd41ee14b6c76b51bbde820d813ca7b9f28

Contents?: true

Size: 1.67 KB

Versions: 363

Compression:

Stored size: 1.67 KB

Contents

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

import DateYearStacked from "./_date_year_stacked";

const TEST_DATE = "01/01/2020 00:00:000 GMT-0500";
jest.setSystemTime(new Date(TEST_DATE));
const testId = "dateyearstacked-kit";
const realDate = Date;

beforeEach(() => {
  global.Date.now = jest.fn(() => new Date(TEST_DATE));
});

afterEach(() => {
  global.Date = realDate;
});

describe("DateYearStacked Kit", () => {
  test("renders DateYearStacked className", () => {
    render(
      <DateYearStacked 
          data={{ testid: testId }} 
          date={new Date(Date.now())} />
    );

    const kit = screen.getByTestId(testId);
    expect(kit).toHaveClass("pb_date_year_stacked_left");
  });

  test("renders DateYearStacked text top", () => {
    render(
      <DateYearStacked 
          data={{ testid: testId }} 
          date={new Date(Date.now())} />
    );

    const kit = screen.getByTestId(testId);
    const text = kit.querySelector(".pb_title_kit_size_4");
    expect(text.textContent).toEqual("1 JAN");
  });

  test("renders DateYearStacked text bottom", () => {
    render(
      <DateYearStacked 
          data={{ testid: testId }} 
          date={new Date(Date.now())} />
    );

    const kit = screen.getByTestId(testId);
    const text = kit.querySelector(".pb_body_kit_light");
    expect(text.textContent).toEqual("2020");
  });

  test("renders align prop", () => {
    render(
      <DateYearStacked
          align="center"
          data={{ testid: testId }}
          date={new Date(Date.now())}
      />
    );

    const kit = screen.getByTestId(testId);
    expect(kit).toHaveClass("pb_date_year_stacked_center");
  });
});

Version data entries

363 entries across 363 versions & 1 rubygems

Version Path
playbook_ui-13.10.0.pre.alpha.dependabotnpmandyarntiptapextensionlink21121407 app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.test.js
playbook_ui-13.10.0.pre.alpha.PLAY1046multilevelsingleselectphase21365 app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.test.js
playbook_ui-13.10.0.pre.alpha.PLAY1046multilevelsingleselectphase21358 app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.test.js
playbook_ui-13.10.0.pre.alpha.play10481357 app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.test.js
playbook_ui-13.10.0.pre.alpha.play845addswiftkitspage1332 app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.test.js
playbook_ui-13.10.0.pre.alpha.PLAY978alphatesthighcharts41330 app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.test.js
playbook_ui-13.10.0.pre.alpha.PLAY1046multilevelsingleselectphase21328 app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.test.js
playbook_ui-13.10.0.pre.alpha.PLAY1046multilevelsingleselectphase21323 app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.test.js
playbook_ui-13.10.0.pre.alpha.play978makehighchartsadevdependencypoc1322 app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.test.js
playbook_ui-13.10.0 app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.test.js
playbook_ui-13.9.0.pre.alpha.play978makehighchartsadevdependencypoc1292 app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.test.js
playbook_ui-13.9.0.pre.alpha.verdaccioregistry1277 app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.test.js
playbook_ui-13.9.0.pre.alpha.play845addswiftkitspage1273 app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.test.js
playbook_ui-13.9.0.pre.alpha.play845addswiftkitspage1272 app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.test.js
playbook_ui-13.9.0.pre.alpha.play845allkitsbytypes1271 app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.test.js
playbook_ui-13.9.0.pre.alpha.play845allkitsbytypes1270 app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.test.js
playbook_ui-13.9.0.pre.alpha.play845allkitsbytypes1268 app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.test.js
playbook_ui-13.9.0.pre.alpha.play845allkitsbytypes1266 app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.test.js
playbook_ui-13.9.0.pre.alpha.play845allkitsbytypes1264 app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.test.js
playbook_ui-13.9.0.pre.alpha.play845allkitsbytypes1263 app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.test.js