@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.
- package/CHANGELOG.json +1 -1
- package/CHANGELOG.md +39 -2
- package/README.md +1 -1
- package/lib/buildProps.d.ts +14 -6
- package/lib/buildProps.js +28 -24
- package/lib/buildProps.js.map +1 -1
- package/lib/buildProps.test.d.ts +1 -1
- package/lib/buildProps.test.js +28 -28
- package/lib/buildProps.test.js.map +1 -1
- package/lib/buildUseStyling.d.ts +30 -27
- package/lib/buildUseStyling.js +30 -31
- package/lib/buildUseStyling.js.map +1 -1
- package/lib/buildUseStyling.test.d.ts +1 -1
- package/lib/buildUseStyling.test.js +67 -64
- package/lib/buildUseStyling.test.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/useStyling.samples.test.d.ts +1 -1
- package/lib/useStyling.samples.test.js +171 -148
- package/lib/useStyling.samples.test.js.map +1 -1
- package/lib-commonjs/buildProps.d.ts +14 -6
- package/lib-commonjs/buildProps.js +32 -29
- package/lib-commonjs/buildProps.js.map +1 -1
- package/lib-commonjs/buildProps.test.d.ts +1 -1
- package/lib-commonjs/buildProps.test.js +32 -32
- package/lib-commonjs/buildProps.test.js.map +1 -1
- package/lib-commonjs/buildUseStyling.d.ts +30 -27
- package/lib-commonjs/buildUseStyling.js +35 -37
- package/lib-commonjs/buildUseStyling.js.map +1 -1
- package/lib-commonjs/buildUseStyling.test.d.ts +1 -1
- package/lib-commonjs/buildUseStyling.test.js +72 -69
- package/lib-commonjs/buildUseStyling.test.js.map +1 -1
- package/lib-commonjs/index.d.ts +1 -1
- package/lib-commonjs/index.js +30 -10
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/useStyling.samples.test.d.ts +1 -1
- package/lib-commonjs/useStyling.samples.test.js +227 -177
- package/lib-commonjs/useStyling.samples.test.js.map +1 -1
- package/package.json +46 -46
- package/src/buildProps.ts +2 -2
- 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
|
-
|
|
133
|
-
|
|
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
|
-
|
|
147
|
-
|
|
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
|
-
|
|
214
|
-
|
|
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
|
-
|
|
221
|
-
expect(
|
|
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
|
-
|
|
239
|
-
|
|
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
|
-
|
|
246
|
-
expect(
|
|
253
|
+
);
|
|
254
|
+
});
|
|
255
|
+
expect(component!.toJSON()).toMatchSnapshot();
|
|
247
256
|
});
|
|
248
257
|
});
|