Skip to content

Commit b87a8ba

Browse files
committed
Try fix remaining tests
1 parent 9488576 commit b87a8ba

3 files changed

Lines changed: 18 additions & 1 deletion

File tree

src/ElectronNET.IntegrationTests/Tests/AutoUpdaterTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ public async Task ChannelAsync_check()
8989
var test = await Electron.AutoUpdater.ChannelAsync;
9090
test.Should().Be(string.Empty);
9191
Electron.AutoUpdater.SetChannel = "beta";
92+
await Task.Delay(500);
9293
test = await Electron.AutoUpdater.ChannelAsync;
9394
test.Should().Be("beta");
9495
}

src/ElectronNET.IntegrationTests/Tests/BrowserWindowTests.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,13 @@ public async Task AlwaysOnTop_toggle_and_query()
9999
public async Task MenuBar_auto_hide_and_visibility()
100100
{
101101
this.fx.MainWindow.SetAutoHideMenuBar(true);
102+
await Task.Delay(500);
102103
(await this.fx.MainWindow.IsMenuBarAutoHideAsync()).Should().BeTrue();
103104
this.fx.MainWindow.SetMenuBarVisibility(false);
105+
await Task.Delay(500);
104106
(await this.fx.MainWindow.IsMenuBarVisibleAsync()).Should().BeFalse();
105107
this.fx.MainWindow.SetMenuBarVisibility(true);
108+
await Task.Delay(500);
106109
(await this.fx.MainWindow.IsMenuBarVisibleAsync()).Should().BeTrue();
107110
}
108111

@@ -202,10 +205,16 @@ public async Task Represented_filename_and_edited_flags()
202205
var temp = Path.Combine(Path.GetTempPath(), "electronnet_test.txt");
203206
File.WriteAllText(temp, "test");
204207
win.SetRepresentedFilename(temp);
208+
209+
await Task.Delay(500);
210+
205211
var represented = await win.GetRepresentedFilenameAsync();
206212
represented.Should().Be(temp);
207213

208214
win.SetDocumentEdited(true);
215+
216+
await Task.Delay(500);
217+
209218
var edited = await win.IsDocumentEditedAsync();
210219
edited.Should().BeTrue();
211220

src/ElectronNET.IntegrationTests/Tests/NotificationTests.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
namespace ElectronNET.IntegrationTests.Tests
22
{
3+
using System.Runtime.InteropServices;
34
using ElectronNET.API;
45
using ElectronNET.API.Entities;
56

@@ -9,21 +10,27 @@ public class NotificationTests
910
[Fact(Timeout = 20000)]
1011
public async Task Notification_create_check()
1112
{
13+
Skip.If(RuntimeInformation.IsOSPlatform(OSPlatform.Linux), "Always returns false. Might need full-blown desktop environment");
14+
1215
var tcs = new TaskCompletionSource();
1316

1417
var options = new NotificationOptions("Notification Title", "Notification test 123");
1518
options.OnShow = () => tcs.SetResult();
1619

20+
await Task.Delay(500);
21+
1722
Electron.Notification.Show(options);
1823

1924
await Task.WhenAny(tcs.Task, Task.Delay(5_000));
2025

2126
tcs.Task.IsCompletedSuccessfully.Should().BeTrue();
2227
}
2328

24-
[Fact(Timeout = 20000)]
29+
[SkippableFact(Timeout = 20000)]
2530
public async Task Notification_is_supported_check()
2631
{
32+
Skip.If(RuntimeInformation.IsOSPlatform(OSPlatform.Linux), "Always returns false. Might need full-blown desktop environment");
33+
2734
var supported = await Electron.Notification.IsSupportedAsync();
2835
supported.Should().BeTrue();
2936
}

0 commit comments

Comments
 (0)