import React from "react";
import { render } from "@testing-library/react-native";
import { Heading } from "./Heading";
import { Text } from "../Text";
describe("when Heading called with text as the only prop", () => {
it("should match snapshot", () => {
const view = render(Default Heading).toJSON();
expect(view).toMatchSnapshot();
});
});
describe("when Heading called with reverseTheme", () => {
it("should match snapshot", () => {
const view = render(
Reverse Theme Heading,
).toJSON();
expect(view).toMatchSnapshot();
});
});
describe("when Heading called with title variation", () => {
it("should match snapshot", () => {
const view = render(
Title Heading,
).toJSON();
expect(view).toMatchSnapshot();
});
});
describe("when Heading called with Subtitle variation", () => {
it("should match snapshot", () => {
const view = render(
Subtitle,
).toJSON();
expect(view).toMatchSnapshot();
});
});
describe("when Heading called with sub-heading variation", () => {
it("should match snapshot", () => {
const view = render(
Sub-Heading,
).toJSON();
expect(view).toMatchSnapshot();
});
});
describe("when Heading called with sub-heading variation and text-color", () => {
it("should match snapshot", () => {
const view = render(
Sub-Heading
,
).toJSON();
expect(view).toMatchSnapshot();
});
});
describe("when Heading called with an alignment", () => {
it("should match snapshot", () => {
const view = render(
Text Aligned Right,
).toJSON();
expect(view).toMatchSnapshot();
});
});
describe("when Heading called with maxLines", () => {
it("should match snapshot", () => {
const view = render(
Text Aligned Right,
).toJSON();
expect(view).toMatchSnapshot();
});
});
describe("when Heading contains nested inline text", () => {
it("renders nested Text within Heading", () => {
const view = render(
Heading before Inner after
,
).toJSON();
expect(view).toMatchSnapshot();
});
});