Skip to content

Commit c69b449

Browse files
committed
fix: update tests/stories
1 parent 0a076c7 commit c69b449

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

site/src/components/Abbr/Abbr.stories.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ const meta: Meta<typeof Abbr> = {
66
component: Abbr,
77
decorators: [
88
(Story) => (
9-
<>
9+
<div className="max-w-prose text-base">
1010
<p>Try the following text out in a screen reader!</p>
1111
<Story />
12-
</>
12+
</div>
1313
),
1414
],
1515
};
@@ -25,9 +25,9 @@ export const InlinedShorthand: Story = {
2525
},
2626
decorators: [
2727
(Story) => (
28-
<p className="max-w-2xl">
28+
<p>
2929
The physical pain of getting bonked on the head with a cartoon mallet
30-
lasts precisely 593{" "}
30+
lasts precisely 593
3131
<span className="underline decoration-dotted">
3232
<Story />
3333
</span>

site/src/components/Abbr/Abbr.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ type AbbreviationData = {
88
};
99

1010
describe(Abbr.name, () => {
11-
it("Has an aria-label that equals the title if the abbreviation is shorthand", () => {
11+
it("Omits abbreviation from screen-reader output if it is shorthand", () => {
1212
const sampleShorthands: AbbreviationData[] = [
1313
{
1414
abbreviation: "ms",
@@ -38,7 +38,7 @@ describe(Abbr.name, () => {
3838
}
3939
});
4040

41-
it("Has an aria label with title and 'flattened' pronunciation if abbreviation is acronym", () => {
41+
it("Adds title and 'flattened' pronunciation if abbreviation is acronym", () => {
4242
const sampleAcronyms: AbbreviationData[] = [
4343
{
4444
abbreviation: "NASA",
@@ -70,7 +70,7 @@ describe(Abbr.name, () => {
7070
}
7171
});
7272

73-
it("Has an aria label with title and initialized pronunciation if abbreviation is initialism", () => {
73+
it("Adds title and initialized pronunciation if abbreviation is initialism", () => {
7474
const sampleInitialisms: AbbreviationData[] = [
7575
{
7676
abbreviation: "FBI",

site/src/components/Abbr/Abbr.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,8 @@ export const Abbr: FC<AbbrProps> = ({
3333
// to inject the actual text content inside the abbr itself
3434
title={title}
3535
className={cn(
36-
"underline-none",
37-
children === children.toUpperCase()
38-
? "tracking-wide"
39-
: "tracking-normal",
36+
"no-underline tracking-normal",
37+
children === children.toUpperCase() && "tracking-wide",
4038
className,
4139
)}
4240
{...delegatedProps}

0 commit comments

Comments
 (0)