Skip to content

Commit 0e5a6e6

Browse files
committed
Try fix remaining tests
1 parent 9488576 commit 0e5a6e6

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

src/ElectronNET.IntegrationTests/Tests/BrowserWindowTests.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,16 @@ public async Task Represented_filename_and_edited_flags()
202202
var temp = Path.Combine(Path.GetTempPath(), "electronnet_test.txt");
203203
File.WriteAllText(temp, "test");
204204
win.SetRepresentedFilename(temp);
205+
206+
await Task.Delay(500);
207+
205208
var represented = await win.GetRepresentedFilenameAsync();
206209
represented.Should().Be(temp);
207210

208211
win.SetDocumentEdited(true);
212+
213+
await Task.Delay(500);
214+
209215
var edited = await win.IsDocumentEditedAsync();
210216
edited.Should().BeTrue();
211217

src/ElectronNET.IntegrationTests/Tests/NotificationTests.cs

Lines changed: 6 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

@@ -14,16 +15,20 @@ public async Task Notification_create_check()
1415
var options = new NotificationOptions("Notification Title", "Notification test 123");
1516
options.OnShow = () => tcs.SetResult();
1617

18+
await Task.Delay(500);
19+
1720
Electron.Notification.Show(options);
1821

1922
await Task.WhenAny(tcs.Task, Task.Delay(5_000));
2023

2124
tcs.Task.IsCompletedSuccessfully.Should().BeTrue();
2225
}
2326

24-
[Fact(Timeout = 20000)]
27+
[SkippableFact(Timeout = 20000)]
2528
public async Task Notification_is_supported_check()
2629
{
30+
Skip.If(RuntimeInformation.IsOSPlatform(OSPlatform.Linux), "Always returns false, even when notifications work. Might need full-blown desktop environment");
31+
2732
var supported = await Electron.Notification.IsSupportedAsync();
2833
supported.Should().BeTrue();
2934
}

0 commit comments

Comments
 (0)