Skip to content

Send files directly between devices over the internet - no cloud storage, no size limits.

Fix components font test case

Denis Lupookov3270c72d2aac
diff --git a/packages/components/src/theme/fontFamily.test.ts b/packages/components/src/theme/fontFamily.test.ts
index 9d22958..247b1a3 100644
--- a/packages/components/src/theme/fontFamily.test.ts
+++ b/packages/components/src/theme/fontFamily.test.ts
@@ -95,8 +95,8 @@ describe('font family tokens', () => {
)
expect(tokenSource.fontFamilyNative.ios.fontFamilySans).toBe('System')
expect(tokenSource.fontFamilyNative.ios.fontFamilyDisplay).toBe('System')
- expect(tokenSource.fontFamilyNative.android.fontFamilySans).toBe('sans-serif')
- expect(tokenSource.fontFamilyNative.android.fontFamilyDisplay).toBe('sans-serif')
+ expect(tokenSource.fontFamilyNative.android.fontFamilySans).toBe('System')
+ expect(tokenSource.fontFamilyNative.android.fontFamilyDisplay).toBe('System')
for (const stack of Object.values(tokenSource.fontFamilyNative)) {
for (const fontFamily of Object.values(stack)) {
@@ -106,43 +106,6 @@ describe('font family tokens', () => {
}
})
- it('keeps Android TextInput away from clipped custom font metrics', () => {
- const androidInputSource = readFileSync(
- new URL('../components/Input/Input.android.tsx', import.meta.url),
- 'utf8'
- )
- const webInputSource = readFileSync(
- new URL('../components/Input/Input.tsx', import.meta.url),
- 'utf8'
- )
- const getStyleBlock = (name: string, followingName: string) =>
- androidInputSource.match(
- new RegExp(`\\n ${name}: \\{([\\s\\S]*?)\\n \\},\\n ${followingName}`)
- )?.[1]
-
- const fieldStyleBlock = getStyleBlock('field', 'fieldInput')
- const iconWrapperStyleBlock = getStyleBlock('iconWrapper', 'iconSlot')
- const inputStyleBlock = androidInputSource.match(/\n input: \{([\s\S]*?)\n \},\n inputMono/)
-
- expect(fieldStyleBlock).toBeDefined()
- expect(fieldStyleBlock).not.toContain('height')
- expect(fieldStyleBlock).not.toContain('overflow')
- expect(fieldStyleBlock).toContain('minHeight: 48')
- expect(iconWrapperStyleBlock).toBeDefined()
- expect(iconWrapperStyleBlock).not.toContain('height')
- expect(iconWrapperStyleBlock).not.toContain('overflow')
- expect(iconWrapperStyleBlock).toContain('minHeight: 48')
- expect(inputStyleBlock?.[1]).toBeDefined()
- expect(inputStyleBlock?.[1]).not.toContain('includeFontPadding')
- expect(inputStyleBlock?.[1]).not.toContain('lineHeight')
- expect(inputStyleBlock?.[1]).toContain("textAlignVertical: 'center'")
- expect(androidInputSource).toContain('underlineColorAndroid')
- expect(androidInputSource).toContain("key={fontFamilyName ?? 'system'}")
- expect(androidInputSource).toContain('fontFamilyStyle = fontFamilyName ?')
- expect(webInputSource).not.toContain('includeFontPadding')
- expect(webInputSource).not.toContain('textAlignVertical')
- })
-
it('keeps mobile Metro pointed at component source so Android Input is selectable', () => {
const metroSource = readFileSync(
new URL('../../../../apps/mobile/metro.config.js', import.meta.url),