Neutral sample account names in tests, check scripts and the site's demo UI
The framework moves to 0e344ee.
This commit is contained in:
parent
83f8c363b4
commit
4c6817ecb5
42 changed files with 136 additions and 136 deletions
|
|
@ -7,13 +7,13 @@ import {
|
|||
|
||||
const U = '2086263555364691968';
|
||||
const OTHER = '1790000000000000001';
|
||||
const BASE = 'https://x.com/playfishies';
|
||||
const BASE = 'https://x.com/otheraccount';
|
||||
|
||||
// Shapes as X sends them (live 2026-09-28): GraphQL user result (UserByScreenName, URT timelines)
|
||||
// and a REST 1.1 user object (friendships/create.json, friends/following/list.json).
|
||||
const gqlUser = (id: string, following: boolean, followers = 21) => ({
|
||||
__typename: 'User', rest_id: id, follow_request_sent: false, privacy: { protected: false },
|
||||
core: { name: 'Fishies', screen_name: 'playfishies' },
|
||||
core: { name: 'Sample', screen_name: 'otheraccount' },
|
||||
relationship_counts: { followers, following: 31 },
|
||||
relationship_perspectives: { followed_by: true, following, live_following: false, blocking: false, muting: false, blocked_by: false },
|
||||
});
|
||||
|
|
@ -93,11 +93,11 @@ test('strip: GraphQL and REST user objects of the listed users only', () => {
|
|||
assert.equal('relationship_perspectives' in mine, false);
|
||||
assert.equal('follow_request_sent' in mine, false);
|
||||
assert.deepEqual(mine.relationship_counts, { following: 31 });
|
||||
assert.deepEqual(mine.core, { name: 'Fishies', screen_name: 'playfishies' }, 'other fields untouched');
|
||||
assert.deepEqual(mine.core, { name: 'Sample', screen_name: 'otheraccount' }, 'other fields untouched');
|
||||
assert.deepEqual(other, gqlUser(OTHER, false), 'other users untouched');
|
||||
const rest = { id: 1, id_str: U, screen_name: 'playfishies', following: false, followers_count: 21, follow_request_sent: false, followed_by: true, legacy: { following: false, followers_count: 21, name: 'x' } };
|
||||
const rest = { id: 1, id_str: U, screen_name: 'otheraccount', following: false, followers_count: 21, follow_request_sent: false, followed_by: true, legacy: { following: false, followers_count: 21, name: 'x' } };
|
||||
assert.equal(stripRelationship([rest], new Set([`follow:${U}`])), 1);
|
||||
assert.deepEqual(rest, { id: 1, id_str: U, screen_name: 'playfishies', followed_by: true, legacy: { name: 'x' } });
|
||||
assert.deepEqual(rest, { id: 1, id_str: U, screen_name: 'otheraccount', followed_by: true, legacy: { name: 'x' } });
|
||||
assert.equal(stripRelationship({ id_str: U, name: 'no relationship fields' }, new Set([`follow:${U}`])), 0);
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue