Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix tests and build failures and incorrect padding #896

Merged
merged 5 commits into from
Nov 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions samples/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<PackageVersion Include="Microsoft.UI.Xaml" Version="2.8.5" />
<PackageVersion Include="Microsoft.Windows.Compatibility" Version="5.0.1" />
<PackageVersion Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.755" />
<PackageVersion Include="Microsoft.WindowsAppSDK" Version="1.2.0" />
<PackageVersion Include="Microsoft.WindowsAppSDK" Version="1.2.221109.1" />
<PackageVersion Include="SkiaSharp.Skottie" Version="2.88.6" />
<PackageVersion Include="SkiaSharp.Views" Version="2.88.5" />
<PackageVersion Include="SkiaSharp.Views.Uno" Version="2.88.6" />
Expand All @@ -30,19 +30,19 @@
<PackageVersion Include="Uno.Extensions.Logging.WebAssembly.Console" Version="1.4.0" />
<PackageVersion Include="Uno.Material" Version="3.0.0-dev.352" />
<PackageVersion Include="Uno.Material.WinUI" Version="3.0.0-dev.352" />
<PackageVersion Include="Uno.UI" Version="5.0.0-dev.1728" />
<PackageVersion Include="Uno.UI" Version="5.1.0-dev.156" />
<PackageVersion Include="Uno.UI.Adapter.Microsoft.Extensions.Logging" Version="4.5.9" />
<PackageVersion Include="Uno.UI.RemoteControl" Version="5.0.0-dev.1728" />
<PackageVersion Include="Uno.UI.Skia.Gtk" Version="5.0.0-dev.1728" />
<PackageVersion Include="Uno.UI.Skia.Wpf" Version="5.0.0-dev.1728" />
<PackageVersion Include="Uno.UI.WebAssembly" Version="5.0.0-dev.1728" />
<PackageVersion Include="Uno.UI.RemoteControl" Version="5.1.0-dev.156" />
<PackageVersion Include="Uno.UI.Skia.Gtk" Version="5.1.0-dev.156" />
<PackageVersion Include="Uno.UI.Skia.Wpf" Version="5.1.0-dev.156" />
<PackageVersion Include="Uno.UI.WebAssembly" Version="5.1.0-dev.156" />
<PackageVersion Include="Uno.UniversalImageLoader" Version="1.9.36" />
<PackageVersion Include="Uno.Wasm.Bootstrap" Version="7.0.20" />
<PackageVersion Include="Uno.Wasm.Bootstrap.DevServer" Version="7.0.20" />
<PackageVersion Include="Uno.WinUI" Version="5.0.0-dev.1728" />
<PackageVersion Include="Uno.WinUI.RemoteControl" Version="5.0.0-dev.1728" />
<PackageVersion Include="Uno.WinUI.Skia.Gtk" Version="5.0.0-dev.1728" />
<PackageVersion Include="Uno.WinUI.WebAssembly" Version="5.0.0-dev.1728" />
<PackageVersion Include="Uno.WinUI" Version="5.1.0-dev.156" />
<PackageVersion Include="Uno.WinUI.RemoteControl" Version="5.1.0-dev.156" />
<PackageVersion Include="Uno.WinUI.Skia.Gtk" Version="5.1.0-dev.156" />
<PackageVersion Include="Uno.WinUI.WebAssembly" Version="5.1.0-dev.156" />
<PackageVersion Include="Xamarin.Android.Support.CustomTabs" Version="28.0.0.3" />
<!-- Required to avoid warnings in 1.9.0.1 of Android.Material - https://github.com/xamarin/AndroidX/issues/727 -->
<PackageVersion Include="Xamarin.AndroidX.Annotation" Version="1.6.0.3" />
Expand Down
2 changes: 1 addition & 1 deletion src/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<ItemGroup>
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.0.0" />
<PackageVersion Include="Microsoft.UI.Xaml" Version="2.7.1" />
<PackageVersion Include="Microsoft.WindowsAppSDK" Version="1.1.5" />
<PackageVersion Include="Microsoft.WindowsAppSDK" Version="1.2.221109.1" />
<PackageVersion Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.755" />
<PackageVersion Include="SkiaSharp" Version="2.88.6" />
<PackageVersion Include="SkiaSharp.NativeAssets.Linux" Version="2.88.6" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System.Text;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Windows.UI.Xaml;
using Uno.Toolkit.RuntimeTests.Helpers;
using Uno.Toolkit.UI;
using Uno.UI.RuntimeTests;
Expand Down
18 changes: 10 additions & 8 deletions src/Uno.Toolkit.RuntimeTests/Tests/NavigationBarTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,25 @@ public async Task MainCommand_In_Popup_Without_Page(MainCommandMode mainCommandM
var popup = new Popup { Width = 100, Height = 100, HorizontalOffset = 100, VerticalOffset = 100, Child = new StackPanel { Children = { navigationBar } } };
var content = new StackPanel { Children = { popup } };

try
EventHandler<object> popupOpened = async (s, e) =>
{
await UnitTestUIContentHelperEx.SetContentAndWait(content);

popup.IsOpen = true;

await UnitTestsUIContentHelper.WaitForIdle();
await UnitTestsUIContentHelper.WaitForLoaded(popup);

Assert.IsTrue(navigationBar.TryPerformMainCommand() == shouldGoBack, "Unexpected result from TryPerformMainCommand");

await UnitTestsUIContentHelper.WaitForIdle();

Assert.IsTrue(popup.IsOpen == !shouldGoBack, "Popup is in an incorrect state");
};

try
{
await UnitTestUIContentHelperEx.SetContentAndWait(content);

popup.Opened += popupOpened;
popup.IsOpen = true;
}
kazo0 marked this conversation as resolved.
Show resolved Hide resolved
finally
{
popup.Opened -= popupOpened;
popup.IsOpen = false;
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/Uno.Toolkit.RuntimeTests/Tests/TabBarTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ public async Task Verify_Padding(

var rootGrid = XamlHelper.LoadXaml<Grid>(@$"
kazo0 marked this conversation as resolved.
Show resolved Hide resolved
<Grid>
<utu:TabBar xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml"" x:Name=""MyTabBar"" Style=""{{StaticResource {styleName}}}"">
<utu:TabBar xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml"" Padding=""{padding[0]},{padding[1]},{padding[2]},{padding[3]}"" Background=""Red"" x:Name=""MyTabBar"" Style=""{{StaticResource {styleName}}}"">
<utu:TabBar.Items>
<utu:TabBarItem Content=""1"" />
<utu:TabBarItem Content=""2"" />
Expand All @@ -240,7 +240,6 @@ public async Task Verify_Padding(
");

var tabBar = (TabBar)rootGrid.FindName("MyTabBar");
tabBar.Padding = new Thickness(padding[0], padding[1], padding[2], padding[3]);

await UnitTestUIContentHelperEx.SetContentAndWait(rootGrid);

Expand Down
2 changes: 1 addition & 1 deletion src/Uno.Toolkit.UI/Controls/TabBar/TabBar.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
AutomationProperties.AutomationId="BelowSelectionIndicatorPresenter"
Opacity="0"
Visibility="Collapsed" />
<ItemsPresenter x:Name="TabBarItemsPresenter" Padding="{TemplateBinding Padding}" />
<ItemsPresenter x:Name="TabBarItemsPresenter" Margin="{TemplateBinding Padding}" />
<utu:TabBarSelectionIndicatorPresenter x:Name="AboveSelectionIndicatorPresenter"
Content="{TemplateBinding SelectionIndicatorContent}"
ContentTemplate="{TemplateBinding SelectionIndicatorContentTemplate}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,8 @@
x:Name="TabBarGrid"
Background="{Binding Path=(um:ControlExtensions.TintedBackground), RelativeSource={RelativeSource TemplatedParent}}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}">
<utu:TabBarSelectionIndicatorPresenter
x:Name="BelowSelectionIndicatorPresenter"
AutomationProperties.AutomationId="BelowSelectionIndicatorPresenter"
Expand All @@ -440,7 +441,7 @@
Owner="{Binding RelativeSource={RelativeSource TemplatedParent}}"
Style="{TemplateBinding SelectionIndicatorPresenterStyle}"
Visibility="Collapsed" />
<ItemsPresenter x:Name="TabBarItemsPresenter" Padding="{TemplateBinding Padding}" />
<ItemsPresenter x:Name="TabBarItemsPresenter" Margin="{TemplateBinding Padding}"/>
<utu:TabBarSelectionIndicatorPresenter
x:Name="AboveSelectionIndicatorPresenter"
AutomationProperties.AutomationId="AboveSelectionIndicatorPresenter"
Expand Down
Loading