@fluentui-react-native/use-styling 0.13.12 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/CHANGELOG.json +1 -1
  2. package/CHANGELOG.md +39 -2
  3. package/README.md +1 -1
  4. package/lib/buildProps.d.ts +14 -6
  5. package/lib/buildProps.js +28 -24
  6. package/lib/buildProps.js.map +1 -1
  7. package/lib/buildProps.test.d.ts +1 -1
  8. package/lib/buildProps.test.js +28 -28
  9. package/lib/buildProps.test.js.map +1 -1
  10. package/lib/buildUseStyling.d.ts +30 -27
  11. package/lib/buildUseStyling.js +30 -31
  12. package/lib/buildUseStyling.js.map +1 -1
  13. package/lib/buildUseStyling.test.d.ts +1 -1
  14. package/lib/buildUseStyling.test.js +67 -64
  15. package/lib/buildUseStyling.test.js.map +1 -1
  16. package/lib/index.d.ts +1 -1
  17. package/lib/index.js +1 -1
  18. package/lib/useStyling.samples.test.d.ts +1 -1
  19. package/lib/useStyling.samples.test.js +171 -148
  20. package/lib/useStyling.samples.test.js.map +1 -1
  21. package/lib-commonjs/buildProps.d.ts +14 -6
  22. package/lib-commonjs/buildProps.js +32 -29
  23. package/lib-commonjs/buildProps.js.map +1 -1
  24. package/lib-commonjs/buildProps.test.d.ts +1 -1
  25. package/lib-commonjs/buildProps.test.js +32 -32
  26. package/lib-commonjs/buildProps.test.js.map +1 -1
  27. package/lib-commonjs/buildUseStyling.d.ts +30 -27
  28. package/lib-commonjs/buildUseStyling.js +35 -37
  29. package/lib-commonjs/buildUseStyling.js.map +1 -1
  30. package/lib-commonjs/buildUseStyling.test.d.ts +1 -1
  31. package/lib-commonjs/buildUseStyling.test.js +72 -69
  32. package/lib-commonjs/buildUseStyling.test.js.map +1 -1
  33. package/lib-commonjs/index.d.ts +1 -1
  34. package/lib-commonjs/index.js +30 -10
  35. package/lib-commonjs/index.js.map +1 -1
  36. package/lib-commonjs/useStyling.samples.test.d.ts +1 -1
  37. package/lib-commonjs/useStyling.samples.test.js +227 -177
  38. package/lib-commonjs/useStyling.samples.test.js.map +1 -1
  39. package/package.json +46 -46
  40. package/src/buildProps.ts +2 -2
  41. package/src/useStyling.samples.test.tsx +23 -14
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react';
2
+ import { act } from 'react';
2
3
  import type { TextProps, ColorValue } from 'react-native';
3
4
  import { Text, View } from 'react-native';
4
5
 
@@ -129,8 +130,11 @@ describe('useStyling samples', () => {
129
130
 
130
131
  /** first render the component with no updates */
131
132
  it('Sample1Text rendering with no overrides', () => {
132
- const tree = renderer.create(<Sample1Text>Sample1a</Sample1Text>).toJSON();
133
- expect(tree).toMatchSnapshot();
133
+ let component: renderer.ReactTestRenderer;
134
+ act(() => {
135
+ component = renderer.create(<Sample1Text>Sample1a</Sample1Text>);
136
+ });
137
+ expect(component!.toJSON()).toMatchSnapshot();
134
138
  });
135
139
 
136
140
  /** now re-theme the component via the components in the theme */
@@ -143,8 +147,11 @@ describe('useStyling samples', () => {
143
147
  },
144
148
  },
145
149
  });
146
- const tree = renderer.create(<Sample1Text>Sample1b</Sample1Text>).toJSON();
147
- expect(tree).toMatchSnapshot();
150
+ let component: renderer.ReactTestRenderer;
151
+ act(() => {
152
+ component = renderer.create(<Sample1Text>Sample1b</Sample1Text>);
153
+ });
154
+ expect(component!.toJSON()).toMatchSnapshot();
148
155
  });
149
156
 
150
157
  /**
@@ -210,15 +217,16 @@ describe('useStyling samples', () => {
210
217
  /** rendering the Sample2 component with the base theme */
211
218
  it('Sample2Text rendering with defaults and a color override', () => {
212
219
  themeHelper.setActive();
213
- const tree = renderer
214
- .create(
220
+ let component: renderer.ReactTestRenderer;
221
+ act(() => {
222
+ component = renderer.create(
215
223
  <View>
216
224
  <Sample2Text>Sample2 with defaults</Sample2Text>
217
225
  <Sample2Text color="green">Sample2 with color override via prop</Sample2Text>
218
226
  </View>,
219
- )
220
- .toJSON();
221
- expect(tree).toMatchSnapshot();
227
+ );
228
+ });
229
+ expect(component!.toJSON()).toMatchSnapshot();
222
230
  });
223
231
 
224
232
  /** now re-theme the component via the components in the theme */
@@ -235,14 +243,15 @@ describe('useStyling samples', () => {
235
243
  },
236
244
  },
237
245
  });
238
- const tree = renderer
239
- .create(
246
+ let component: renderer.ReactTestRenderer;
247
+ act(() => {
248
+ component = renderer.create(
240
249
  <View>
241
250
  <Sample2Text>Sample2 with theme overrides set</Sample2Text>
242
251
  <Sample2Text color="purple">Sample2 with theme and color prop override</Sample2Text>
243
252
  </View>,
244
- )
245
- .toJSON();
246
- expect(tree).toMatchSnapshot();
253
+ );
254
+ });
255
+ expect(component!.toJSON()).toMatchSnapshot();
247
256
  });
248
257
  });