Skip to content

Commit 2695234

Browse files
committed
add uitoolkit tests and svg component snapshot tests
1 parent 82fa773 commit 2695234

20 files changed

+815
-12
lines changed

Runtime/Frameworks/UIToolkit/VisualElements/SvgElement.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22
using System.Collections.Generic;
33
using System.IO;
44
using System.Reflection;
5-
using Unity.VectorGraphics;
65
using UnityEngine;
76
using UnityEngine.UIElements;
87
using Object = UnityEngine.Object;
98

9+
#if REACT_VECTOR_GRAPHICS
10+
using Unity.VectorGraphics;
11+
#endif
12+
1013
namespace ReactUnity.UIToolkit
1114
{
1215
public class SvgElement : Image

Runtime/ReactUnity.asmdef

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@
6060
"name": "Unity",
6161
"expression": "",
6262
"define": "REACT_DISABLE_YANTRA"
63+
},
64+
{
65+
"name": "Unity",
66+
"expression": "2021.2.0a",
67+
"define": "REACT_UITOOLKIT"
6368
}
6469
],
6570
"noEngineReferences": false
1.81 KB
Loading
1.81 KB
Loading

Tests/Runtime/ReactUnity.Tests.asmdef

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,16 @@
3535
"name": "com.unity.inputsystem",
3636
"expression": "",
3737
"define": "REACT_INPUT_SYSTEM"
38+
},
39+
{
40+
"name": "Unity",
41+
"expression": "2021.2.0a",
42+
"define": "REACT_UITOOLKIT"
43+
},
44+
{
45+
"name": "com.unity.vectorgraphics",
46+
"expression": "",
47+
"define": "REACT_VECTOR_GRAPHICS"
3848
}
3949
],
4050
"noEngineReferences": false
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
%YAML 1.1
2+
%TAG !u! tag:unity3d.com,2011:
3+
--- !u!114 &11400000
4+
MonoBehaviour:
5+
m_ObjectHideFlags: 0
6+
m_CorrespondingSourceObject: {fileID: 0}
7+
m_PrefabInstance: {fileID: 0}
8+
m_PrefabAsset: {fileID: 0}
9+
m_GameObject: {fileID: 0}
10+
m_Enabled: 1
11+
m_EditorHideFlags: 0
12+
m_Script: {fileID: 19101, guid: 0000000000000000e000000000000000, type: 0}
13+
m_Name: PanelSettings
14+
m_EditorClassIdentifier:
15+
themeUss: {fileID: -4733365628477956816, guid: 5827889da7889804cbd452f4d69399d8,
16+
type: 3}
17+
m_TargetTexture: {fileID: 0}
18+
m_ScaleMode: 1
19+
m_Scale: 1
20+
m_ReferenceDpi: 96
21+
m_FallbackDpi: 96
22+
m_ReferenceResolution: {x: 1200, y: 800}
23+
m_ScreenMatchMode: 0
24+
m_Match: 0
25+
m_SortingOrder: 0
26+
m_TargetDisplay: 0
27+
m_ClearDepthStencil: 1
28+
m_ClearColor: 0
29+
m_ColorClearValue: {r: 0, g: 0, b: 0, a: 0}
30+
m_DynamicAtlasSettings:
31+
m_MinAtlasSize: 64
32+
m_MaxAtlasSize: 4096
33+
m_MaxSubTextureSize: 64
34+
m_ActiveFilters: 31
35+
m_AtlasBlitShader: {fileID: 9101, guid: 0000000000000000f000000000000000, type: 0}
36+
m_RuntimeShader: {fileID: 9100, guid: 0000000000000000f000000000000000, type: 0}
37+
m_RuntimeWorldShader: {fileID: 9102, guid: 0000000000000000f000000000000000, type: 0}
38+
textSettings: {fileID: 0}

Tests/Runtime/Resources/ReactUnity/tests/PanelSettings.asset.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Tests/Runtime/TestScene.unity

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ Canvas:
176176
m_OverridePixelPerfect: 0
177177
m_SortingBucketNormalizedSize: 0
178178
m_AdditionalShaderChannelsFlag: 0
179+
m_UpdateRectTransformForStandalone: 0
179180
m_SortingLayerID: 0
180181
m_SortingOrder: 0
181182
m_TargetDisplay: 0
@@ -425,16 +426,17 @@ MonoBehaviour:
425426
Language: 0
426427
SourceAsset: {fileID: 4900000, guid: 1cea8ca938b8ac346ad799e56a0afa8b, type: 3}
427428
Watch: 1
428-
SourcePath: react/index#material
429+
SourcePath: react/index
429430
SourceText:
430431
ResourcesPath:
431432
UseDevServer: 1
432-
DevServer: http://localhost:3100#material
433+
DevServer: http://localhost:3100
433434
Debug: 0
434435
AwaitDebugger: 0
435436
EngineType: 0
436437
Globals:
437438
Entries: []
439+
Stylesheets: []
438440
AutoRender: 1
439441
BeforeStart:
440442
m_PersistentCalls:

0 commit comments

Comments
 (0)