End-to-end tests against the pasture; profiles, follows, search, votes, reactions
tests/e2e (Playwright for .NET 1.61.0 on xunit v3, the Chromium 1228 already cached, never downloaded, never in CI) runs the published app against SocialPub's pasture and its town: run.sh publishes it with the Pasture environment (wwwroot/appsettings.Pasture.json, published only then; the deploy fails if it ever ships) and serves it as https://decepub.test. The tests sign in through the real login page and persona chooser, check that every request goes only to decepub.test and privapub.test with the right credential on the right API, render one post of each kind from each platform as its author wrote it, and check every action on the other side of the wire (town.sh stored): favourites, boosts and replies with their undoing, follows from a profile, votes, reactions. Each test is also a cell of the town's report (out/client.jsonl). They found two PrivaPub bugs fixed there (a blocked author's status answered null; sensitive remote media invented a content warning) and a reply addressed to nobody. New in the app, all checked by those tests: - profiles at /account/{id}: header, bio, fields, counts, the account's posts as posts, posts and replies, or media, and follow, unfollow, cancel a request, mute and block (AccountService); post authors and notifications open them in the app; - search at /search: accounts, posts and hashtags, a handle or an address resolved by PrivaPub; - poll voting on the card, and emoji reactions shown and given with one tap; before a persona's first reaction or vote it is told once that both are public (PublicNoticeService, the owner's decision); - follow requests answered from their notification. 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
0f68e74e38
commit
011bafb6af
39 files changed
+2074
-17
No files matched your search
@@ -45,6 +45,10 @@ public static class APIs
|
||||
public const string GET_Conversations = "api/v1/conversations";
|
||||
public const string GET_Notifications = "api/v1/notifications";
|
||||
public const string POST_Media = "api/v2/media";
|
||||
public const string GET_AccountLookup = "api/v1/accounts/lookup";
|
||||
public const string GET_Relationships = "api/v1/accounts/relationships";
|
||||
public const string GET_FollowRequests = "api/v1/follow_requests";
|
||||
public const string GET_Search = "api/v2/search";
|
||||
|
||||
public static string GET_M_TagTimeline(string tag) => $"api/v1/timelines/tag/{Uri.EscapeDataString(tag)}";
|
||||
public static string GET_M_Account(string accountId) => $"api/v1/accounts/{Uri.EscapeDataString(accountId)}";
|
||||
@@ -54,6 +58,10 @@ public static class APIs
|
||||
public static string DELETE_M_Status(string statusId) => $"api/v1/statuses/{Uri.EscapeDataString(statusId)}";
|
||||
public static string POST_M_StatusAction(string statusId, string action) => $"api/v1/statuses/{Uri.EscapeDataString(statusId)}/{action}";
|
||||
public static string POST_M_AccountAction(string accountId, string action) => $"api/v1/accounts/{Uri.EscapeDataString(accountId)}/{action}";
|
||||
public static string M_Reaction(string statusId, string emoji) =>
|
||||
$"api/v1/pleroma/statuses/{Uri.EscapeDataString(statusId)}/reactions/{Uri.EscapeDataString(emoji)}";
|
||||
public static string POST_M_PollVotes(string pollId) => $"api/v1/polls/{Uri.EscapeDataString(pollId)}/votes";
|
||||
public static string POST_M_FollowRequest(string accountId, string answer) => $"api/v1/follow_requests/{Uri.EscapeDataString(accountId)}/{answer}";
|
||||
}
|
||||
|
||||
public static class PrivaPub
|
||||
|
||||
@@ -53,6 +53,17 @@ public class Relationship
|
||||
public bool Following { get; set; }
|
||||
public bool FollowedBy { get; set; }
|
||||
public bool Blocking { get; set; }
|
||||
public bool BlockedBy { get; set; }
|
||||
public bool Muting { get; set; }
|
||||
public bool Requested { get; set; }
|
||||
public bool RequestedBy { get; set; }
|
||||
public bool DomainBlocking { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>/api/v2/search: what matched, a remote handle or URL resolved by PrivaPub.</summary>
|
||||
public class SearchResults
|
||||
{
|
||||
public List<Account> Accounts { get; set; } = [];
|
||||
public List<Status> Statuses { get; set; } = [];
|
||||
public List<StatusTag> Hashtags { get; set; } = [];
|
||||
}
|
||||
@@ -40,6 +40,8 @@ public class Status
|
||||
public string Text { get; set; }
|
||||
public PrivaPubStatus Privapub { get; set; }
|
||||
public Quote Quote { get; set; }
|
||||
/// <summary>Emoji reactions (PrivaPub sends Pleroma's and Misskey's forms as one list).</summary>
|
||||
public List<EmojiReaction> EmojiReactions { get; set; } = [];
|
||||
public int QuotesCount { get; set; }
|
||||
}
|
||||
|
||||
@@ -85,9 +87,28 @@ public class Poll
|
||||
public int VotesCount { get; set; }
|
||||
public int? VotersCount { get; set; }
|
||||
public bool? Voted { get; set; }
|
||||
/// <summary>The options the current persona chose (indexes).</summary>
|
||||
public List<int> OwnVotes { get; set; } = [];
|
||||
public List<PollOption> Options { get; set; } = [];
|
||||
}
|
||||
|
||||
public class EmojiReaction
|
||||
{
|
||||
/// <summary>The emoji itself, or a custom emoji's shortcode.</summary>
|
||||
public string Name { get; set; }
|
||||
public int Count { get; set; }
|
||||
/// <summary>Whether the current persona reacted with it.</summary>
|
||||
public bool Me { get; set; }
|
||||
/// <summary>A custom emoji's image, through PrivaPub's proxy.</summary>
|
||||
public string Url { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>POST /api/v1/polls/{id}/votes.</summary>
|
||||
public class PollVoteForm
|
||||
{
|
||||
public List<int> Choices { get; set; } = [];
|
||||
}
|
||||
|
||||
public class PollOption
|
||||
{
|
||||
public string Title { get; set; }
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace decePubClient.Models;
|
||||
|
||||
/// <summary>
|
||||
/// The personas already told that their reactions and poll votes are public (owner decision, PrivaPub's ROADMAP: each
|
||||
/// persona is told once, before its first reaction or vote). Kept in localStorage under its type name.
|
||||
/// </summary>
|
||||
public class PublicActionNotices
|
||||
{
|
||||
public List<string> PersonaIds { get; set; } = [];
|
||||
}
|
||||
Reference in new issue
Block a user