Files
gui/apps/kitchen-sink/tests/VariantsOrder.test.tsx
zeekayandHanzo Dev 38a546e67c restore @hanzo_network packages and team app dropped by the transplant
The transplant rebuilt the tree on upstream tamagui and carried our own
packages forward by hand, which silently lost seven @hanzo_network/*
packages and apps/team — 735 files with no other home in the workspace.
They are back at the tip of the old lineage's content.

pkgs/ai is NOT restored: @hanzo/ai is published from hanzo-js/ai, so a
copy here would be the duplicate we are trying to avoid.
templates/expo-router is NOT restored: apps/starters/expo-router already
declares that exact package name upstream.

Also fixes a rebrand defect: the blanket tamagui->hanzogui rule rewrote
upstream's GitHub path into github.com/hanzogui/hanzogui, a repo that has
never existed, and it shipped in repository.url for every published
package. The transform now maps the remote to hanzoai/gui and repairs a
tree already branded wrong, so a future sync cannot reintroduce it.

Co-authored-by: Hanzo Dev <[email protected]>
2026-07-30 19:53:12 -07:00

54 lines
1.9 KiB
TypeScript

import { expect, test } from '@playwright/test'
import { setupPage } from './test-utils'
import { getStyles } from './utils'
test.beforeEach(async ({ page }) => {
await setupPage(page, { name: 'VariantsOrder', type: 'useCase' })
})
test(`variants apply below default props but above parent defaultvariants/props as you nest styled()`, async ({
page,
}) => {
expect(await getStyles(page.getByTestId('button').first())).toMatchObject({
flexDirection: 'row',
})
expect(await getStyles(page.getByTestId('text1').first())).toMatchObject({
fontSize: '16px',
})
expect(await getStyles(page.getByTestId('text2').first())).toMatchObject({
fontSize: '15px',
})
expect(await getStyles(page.getByTestId('text3').first())).toMatchObject({
fontSize: '30px',
})
expect(await getStyles(page.getByTestId('text4').first())).toMatchObject({
fontSize: '40px',
})
})
// Issue #3669: https://github.com/hanzoai/gui/issues/3669
test(`variant chaining: child variant (test2) translates to parent variant (test) and propagates via context`, async ({
page,
}) => {
// Direct test=true on ButtonFrame
const directFrame = await getStyles(page.getByTestId('frame-test-direct').first())
expect(directFrame.backgroundColor).toBe('rgb(255, 0, 0)') // red
// test2=true on ButtonFrame2 should translate to test=true
const chainedFrame = await getStyles(page.getByTestId('frame-test2-chained').first())
expect(chainedFrame.backgroundColor).toBe('rgb(255, 0, 0)') // same red
// ButtonText inside direct test should get white color via context
const directText = await getStyles(page.getByTestId('text-test-direct').first())
expect(directText.color).toBe('rgb(255, 255, 255)') // white
// ButtonText inside chained test2 should also get white via context
const chainedText = await getStyles(page.getByTestId('text-test2-chained').first())
expect(chainedText.color).toBe('rgb(255, 255, 255)') // white - this is the regression
})