Skip to content

Commit d6346eb

Browse files
committed
fix: [Heading] Rename "Super" heading to "Display" heading
1 parent 1893242 commit d6346eb

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

src/components/Headings/Heading.test.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ describe('<Heading />', () => {
2424
}
2525
});
2626

27-
it('Renders Super heading', () => {
28-
const headingType = `super`;
27+
it('Renders Display heading', () => {
28+
const headingType = `display`;
2929
const testid = `h${headingType}`;
3030
const text = `Heading level ${headingType}`;
3131

@@ -39,7 +39,7 @@ describe('<Heading />', () => {
3939

4040
expect(current).toBeInTheDocument();
4141
expect(current.tagName.toLowerCase()).toBe('h1');
42-
expect(current.classList.contains('super'));
42+
expect(current.className === 'superheading').toBeTruthy();
4343
});
4444

4545
it('Renders Eyebrow heading', () => {
@@ -57,7 +57,7 @@ describe('<Heading />', () => {
5757

5858
expect(current).toBeInTheDocument();
5959
expect(current.tagName.toLowerCase()).toBe('h5');
60-
expect(current.classList.contains('eyebrow'));
60+
expect(current.className.includes('eyebrow')).toBeTruthy();
6161
});
6262

6363
it('Renders Slug heading', () => {

src/components/Headings/Heading.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ export type HeadingType =
88
| '4'
99
| '5'
1010
| '6'
11+
| 'display'
1112
| 'eyebrow'
12-
| 'slug'
13-
| 'super';
13+
| 'slug';
1414

1515
interface HeadingProperties extends React.HTMLProps<HTMLHeadingElement> {
16-
/** Heading type (1-6, super, eyebrow, slug) */
16+
/** Heading type (1-6, display, eyebrow, slug) */
1717
type?: HeadingType;
1818
/** Heading content */
1919
children: JSXElement | string;
@@ -38,7 +38,7 @@ export const Heading = ({
3838
);
3939
}
4040

41-
if (type === 'super') {
41+
if (type === 'display') {
4242
DynamicHeading = 'h1';
4343
classes.push('superheading');
4444
} else if (type === 'eyebrow') {

src/components/Headings/Headings.stories.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ export default meta;
2323

2424
type Story = StoryObj<typeof meta>;
2525

26-
export const Superheading: Story = {
27-
name: 'Super heading',
26+
export const Display: Story = {
27+
name: 'Display heading',
2828
args: {
29-
type: 'super',
29+
type: 'display',
3030
children: 'Display heading'
3131
}
3232
};

0 commit comments

Comments
 (0)