Persistance de SearchText ajoutée

This commit is contained in:
Paul Schneider 2026-08-29 14:34:43 +01:00
commit 24046ac632
Signed by: notazof
GPG key ID: 1DD5D838E5343B06
13 changed files with 302 additions and 197 deletions

View file

@ -81,7 +81,7 @@ public class MainPageSaveTests
Assert.NotEmpty(recorder.Calls);
var (method, path, body) = recorder.FirstCall;
Assert.Equal(HttpMethod.Post, method);
Assert.Equal("blog", path);
Assert.Equal("blogspot", path);
var sent = Assert.IsType<BlogPostDto>(body);
Assert.Equal(typed, sent.Title);
}

View file

@ -1,3 +1,5 @@
using System.Text.Json;
namespace PostIt.Tests;
public class SettingsLoadTests
@ -149,4 +151,26 @@ public class SettingsLoadTests
Assert.True(settings.Loaded);
}
[Fact]
public void SearchText_is_serialized_in_settings_and_round_trips()
{
var settings = new PostIt.ViewModels.Settings
{
Authentication = new AuthenticationSettings
{
Authority = "https://example.test/",
ClientId = "postit-tests",
Scopes = new[] { "openid" }
}
};
settings.SearchText = "bonjour";
var json = JsonSerializer.Serialize(settings);
var roundTrip = JsonSerializer.Deserialize<PostIt.ViewModels.Settings>(json);
Assert.NotNull(roundTrip);
Assert.Equal("bonjour", roundTrip.SearchText);
}
}