-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Update CI pipeline to publish icons package and remove unused D…
…arkThemeToggle tests
- Loading branch information
Showing
4 changed files
with
10 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,3 @@ | |
> [email protected] build:esm C:\Users\pol.gubau\dev\mine\ui\pol-ui\packages\ui | ||
> tsc -p tsconfig.lib.json --module esnext --declaration --outDir ./lib/esm | ||
|
||
|
||
> [email protected] build:cjs C:\Users\pol.gubau\dev\mine\ui\pol-ui\packages\ui | ||
> tsc -p tsconfig.lib.json | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,80 +1,16 @@ | ||
import { render, screen } from '@testing-library/react' | ||
import { describe, expect, it } from 'vitest' | ||
import { PoluiProvider, type CustomPoluiTheme } from '../PoluiProvider' | ||
import { Card } from './Card' | ||
import { render, screen } from "@testing-library/react" | ||
import { describe, expect, it } from "vitest" | ||
|
||
describe('Components / Card', () => { | ||
describe('A11y', () => { | ||
it('should allow `aria-label`', () => { | ||
render(<Card aria-label="My card" />) | ||
|
||
expect(card()).toHaveAccessibleName('My card') | ||
}) | ||
}) | ||
|
||
describe('Rendering', () => { | ||
it('should render an `<a>` given `href=".."`', () => { | ||
render(<Card href="#" />) | ||
|
||
expect(screen.getByRole('link')).toEqual(card()) | ||
}) | ||
}) | ||
import { Card } from "./Card" | ||
|
||
describe('Theme', () => { | ||
it('should use `base` classes', () => { | ||
const theme: CustomPoluiTheme = { | ||
card: { | ||
root: { | ||
base: 'text-cyan-100', | ||
}, | ||
}, | ||
} | ||
render( | ||
<PoluiProvider theme={{ theme }}> | ||
<Card /> | ||
</PoluiProvider>, | ||
) | ||
|
||
expect(card()).toHaveClass('text-cyan-100') | ||
}) | ||
|
||
it('should use `children` classes', () => { | ||
const theme: CustomPoluiTheme = { | ||
card: { | ||
root: { | ||
children: 'text-cyan-900', | ||
}, | ||
}, | ||
} | ||
render( | ||
<PoluiProvider theme={{ theme }}> | ||
<Card> | ||
<span aria-label="The content">Some content</span> | ||
</Card> | ||
</PoluiProvider>, | ||
) | ||
const children = screen.getByLabelText('The content') | ||
|
||
expect(children.parentElement).toHaveClass('text-cyan-900') | ||
}) | ||
|
||
it('should use `href` classes', () => { | ||
const theme: CustomPoluiTheme = { | ||
card: { | ||
root: { | ||
href: 'text-cyan-700', | ||
}, | ||
}, | ||
} | ||
render( | ||
<PoluiProvider theme={{ theme }}> | ||
<Card href="#">My card</Card> | ||
</PoluiProvider>, | ||
) | ||
describe("Components / Card", () => { | ||
describe("A11y", () => { | ||
it("should allow `aria-label`", () => { | ||
render(<Card aria-label="My card" />) | ||
|
||
expect(card()).toHaveClass('text-cyan-700') | ||
expect(card()).toHaveAccessibleName("My card") | ||
}) | ||
}) | ||
}) | ||
|
||
const card = () => screen.getByTestId('ui-card') | ||
const card = () => screen.getByTestId("ui-card") |
22 changes: 0 additions & 22 deletions
22
packages/ui/src/components/DarkThemeToggle/DarkThemeToggle.spec.tsx
This file was deleted.
Oops, something went wrong.