Skip to content

Commit 1649007

Browse files
committed
fix tests
1 parent 509c153 commit 1649007

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@servicestack/react",
3-
"version": "2.0.15",
3+
"version": "2.0.14",
44
"repository": {
55
"type": "git",
66
"url": "https://github.com/ServiceStack/servicestack-react"

tests/unit/PrimaryButton.test.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,17 @@ test('renders with Link when href is provided', () => {
118118
expect(link?.getAttribute('href')).toBe('/test')
119119
})
120120

121-
test('renders button inside Link when href is provided', () => {
121+
test('renders Link with button styling when href is provided', () => {
122122
const { container } = renderWithRouter(
123123
<PrimaryButton href="/test">Link Button</PrimaryButton>
124124
)
125125

126126
const link = container.querySelector('a')
127-
const button = link?.querySelector('button')
128-
expect(button).toBeTruthy()
129-
expect(button?.textContent).toBe('Link Button')
127+
expect(link).toBeTruthy()
128+
expect(link?.textContent).toBe('Link Button')
129+
// Should have button-like styling classes
130+
expect(link?.classList.contains('inline-flex')).toBe(true)
131+
expect(link?.classList.contains('bg-indigo-600')).toBe(true)
130132
})
131133

132134
test('applies disabled attribute', () => {

0 commit comments

Comments
 (0)