Utilities and UI components for cross-platform React Native apps
0

Configure Feed

Select the types of activity you want to include in your feed.

refactor: move test fixtures below tests

The test names/descriptions are more important than the specifics of the fixture data.

Joseph Hale (Nov 11, 2025, 3:23 PM -0700) a88e8a4c be2b0093

+31 -31
+31 -31
src/theme/__tests__/useTheme.test.ts
··· 9 9 import { createTheme } from '../createTheme'; 10 10 import { act, renderHook } from '@testing-library/react-native'; 11 11 12 - interface BasicColors extends ThemeColors { 13 - primary: string; 14 - background: string; 15 - } 16 - 17 - const basicTheme: ThemeDefinition<BasicColors> = { 18 - name: 'basic', 19 - fonts: DefaultFonts, 20 - light: { 21 - primary: 'basic-light-primary', 22 - background: 'basic-light-background', 23 - } satisfies BasicColors, 24 - dark: { 25 - primary: 'basic-dark-primary', 26 - background: 'basic-dark-background', 27 - } satisfies BasicColors, 28 - }; 29 - 30 - const altTheme: ThemeDefinition<BasicColors> = { 31 - name: 'basic-alt', 32 - fonts: DefaultFonts, 33 - light: { 34 - primary: 'alt-light-primary', 35 - background: 'alt-light-background', 36 - }, 37 - dark: { 38 - primary: 'alt-dark-primary', 39 - background: 'alt-dark-background', 40 - }, 41 - }; 42 - 43 12 describe('useTheme', () => { 44 13 it('provides the default theme', () => { 45 14 const { useTheme } = createTheme<BasicColors>(basicTheme); ··· 99 68 expect(theme.colors.background).toBe(basicTheme.light.background); 100 69 }); 101 70 }); 71 + 72 + interface BasicColors extends ThemeColors { 73 + primary: string; 74 + background: string; 75 + } 76 + 77 + const basicTheme: ThemeDefinition<BasicColors> = { 78 + name: 'basic', 79 + fonts: DefaultFonts, 80 + light: { 81 + primary: 'basic-light-primary', 82 + background: 'basic-light-background', 83 + } satisfies BasicColors, 84 + dark: { 85 + primary: 'basic-dark-primary', 86 + background: 'basic-dark-background', 87 + } satisfies BasicColors, 88 + }; 89 + 90 + const altTheme: ThemeDefinition<BasicColors> = { 91 + name: 'basic-alt', 92 + fonts: DefaultFonts, 93 + light: { 94 + primary: 'alt-light-primary', 95 + background: 'alt-light-background', 96 + }, 97 + dark: { 98 + primary: 'alt-dark-primary', 99 + background: 'alt-dark-background', 100 + }, 101 + };