An edited post's versions open from its card
The card marks an edited post with a button that opens its versions, newest first (/statuses/:id/history), each with its time, warning and words; PrivaPub now has a remote post's earlier versions from Pleroma's formerRepresentations too. The composer's e2e test opens the history after its edit. The wall test retries smuser's post while Smithereen has not yet had the persona's Accept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LsXgEaXee4GCU1hwYgPJXw
This commit is contained in:
1 parent
03824babbc
commit
bb68ff8d5e
10 files changed
+91
-8
No files matched your search
@@ -6,8 +6,8 @@ using Microsoft.Playwright;
|
||||
|
||||
namespace decePubClient.E2E.Actions
|
||||
{
|
||||
// The composer beyond words: a poll in a language picked, the persona's own post edited, and a quote, each checked on
|
||||
// PrivaPub
|
||||
// The composer beyond words: a poll in a language picked, the persona's own post edited and its history shown, and a
|
||||
// quote, each checked on PrivaPub
|
||||
public sealed class ComposerTests(Browser browser)
|
||||
{
|
||||
static async Task OpenHome(IPage page)
|
||||
@@ -85,6 +85,14 @@ namespace decePubClient.E2E.Actions
|
||||
await card.GetByRole(AriaRole.Button, new() { Name = "Save" }).ClickAsync();
|
||||
await Assertions.Expect(card).ToContainTextAsync(text + " (edited)", new() { Timeout = 10000 });
|
||||
Assert.Contains("(edited)", (await PersonaApi.Call(persona, $"/api/v1/statuses/{id}"))!["content"]!.GetValue<string>());
|
||||
await card.Locator("button[data-history]").ClickAsync();
|
||||
var versions = card.Locator("[data-history-list] [data-version]");
|
||||
await Assertions.Expect(versions).ToHaveCountAsync(2, new() { Timeout = 10000 });
|
||||
await Assertions.Expect(versions.First).ToContainTextAsync(text + " (edited)");
|
||||
await Assertions.Expect(versions.Last).ToContainTextAsync(text);
|
||||
await Assertions.Expect(versions.Last).Not.ToContainTextAsync("(edited)");
|
||||
await page.Keyboard.PressAsync("Escape");
|
||||
await Assertions.Expect(card.Locator("[data-history-list]")).ToHaveCountAsync(0);
|
||||
|
||||
await card.Locator("footer [title='Other'] > [role=button]").ClickAsync();
|
||||
await card.Locator("button[data-quote]").ClickAsync();
|
||||
|
||||
@@ -57,8 +57,12 @@ namespace decePubClient.E2E.Actions
|
||||
(await PersonaApi.Call(persona, $"/api/v1/accounts/relationships?id[]={smuser}"))![0]!["followed_by"]!.GetValue<bool>(), 45), "smuser never followed the persona");
|
||||
|
||||
var text = $"a word on the wall {Guid.NewGuid():N}"[..32];
|
||||
var written = (await Smithereen(token, "wall.post", ("owner_id", personaOnSm), ("message", text)))?["response"]?.ToString();
|
||||
Assert.False(string.IsNullOrEmpty(written), "Smithereen refused smuser's post on the persona's wall");
|
||||
// (Smithereen lets its followers write there once the persona's Accept has reached it, which may be after
|
||||
// PrivaPub counts the follow)
|
||||
var written = default(string);
|
||||
Assert.True(await Pasture.Eventually(async () =>
|
||||
!string.IsNullOrEmpty(written = (await Smithereen(token, "wall.post", ("owner_id", personaOnSm), ("message", text)))?["response"]?.ToString()), 30),
|
||||
"Smithereen refused smuser's post on the persona's wall");
|
||||
JsonNode status = null;
|
||||
Assert.True(await Pasture.Eventually(async () =>
|
||||
(status = (await PersonaApi.Call(persona, "/api/v1/timelines/home?limit=40"))!.AsArray()
|
||||
|
||||
Reference in new issue
Block a user