Skip to content

Commit

Permalink
feat: Update CI pipeline to publish icons package and remove unused D…
Browse files Browse the repository at this point in the history
…arkThemeToggle tests
  • Loading branch information
PolGubau committed Nov 19, 2024
1 parent acc039c commit 934f11c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 100 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ jobs:
if: github.ref == 'refs/heads/main'
run: |
echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > ~/.npmrc
cd packages/ui
cd packages/icons
pnpm publish --no-git-checks
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
4 changes: 0 additions & 4 deletions packages/ui/.turbo/turbo-build.log
Original file line number Diff line number Diff line change
Expand Up @@ -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

82 changes: 9 additions & 73 deletions packages/ui/src/components/Card/Card.spec.tsx
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")

This file was deleted.

0 comments on commit 934f11c

Please sign in to comment.