A moved account's profile says where it went
PrivaPub now fills `moved` once a move is believed; the profile shows it, linking the new account's profile. The e2e opens the account SocialPub's moves scenario moved and finds the new one named. 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
228708c328
commit
f9de55ffd5
6 files changed
+51
No files matched your search
@@ -24,6 +24,39 @@ namespace decePubClient.E2E.Actions
|
||||
return candidates.Last();
|
||||
}
|
||||
|
||||
// the newest GoToSocial account that SocialPub's moves scenario moved (scenarios/moves.sh), as PrivaPub knows it
|
||||
static async Task<(string Old, string New)> Moved()
|
||||
{
|
||||
var start = new System.Diagnostics.ProcessStartInfo("podman") { RedirectStandardOutput = true, RedirectStandardError = true };
|
||||
foreach (var arg in new[] { "exec", "pasture-mongo", "mongosh", "--quiet", "PrivaPub", "--eval",
|
||||
"const a = db.ForeignAvatar.find({ActorURI: {$regex: 'gts.test.users.mvold'}, MovedToURL: {$ne: null}}).sort({_id: -1}).limit(1).toArray()[0];" +
|
||||
"print(a ? a.ActorURI + ' ' + a.MovedToURL : '')" })
|
||||
start.ArgumentList.Add(arg);
|
||||
using var process = System.Diagnostics.Process.Start(start)!;
|
||||
var output = (await process.StandardOutput.ReadToEndAsync()).Trim();
|
||||
await process.WaitForExitAsync();
|
||||
var parts = output.Split(' ', StringSplitOptions.RemoveEmptyEntries);
|
||||
return parts.Length == 2 ? (parts[0], parts[1]) : default;
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task A_moved_accounts_profile_says_where_it_went()
|
||||
{
|
||||
var (old, moved) = await Moved();
|
||||
Assert.SkipWhen(old is null, "no moved account: run SocialPub's tools/pasture/interop.sh moves");
|
||||
var persona = Pasture.Personas().First();
|
||||
var handle = old.Split("/users/")[1] + "@gts.test";
|
||||
await using var session = await SignIn.As(browser, persona);
|
||||
await Results.Cell("client.render.moved", "gts", handle, async () =>
|
||||
{
|
||||
await session.Page.GotoAsync($"{Pasture.Site}/search?q={Uri.EscapeDataString("@" + handle)}");
|
||||
var banner = session.Page.Locator("[data-moved]");
|
||||
await banner.WaitForAsync(new() { Timeout = 30000 });
|
||||
await Assertions.Expect(banner).ToContainTextAsync("@" + moved.Split("/users/")[1] + "@gts.test");
|
||||
await session.AssertGuards();
|
||||
}, session.Page);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[MemberData(nameof(Origins))]
|
||||
public async Task A_remote_account_found_by_its_handle_is_followed_and_unfollowed_from_its_profile(string platform)
|
||||
|
||||
Reference in new issue
Block a user