mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-04 21:15:45 +02:00
fix(backend): handle array or string in alsoKnownAs (#17275)
* fix: handle array or string in alsoKnownAs, closes #17274 * style: use more idiomatic toArray() for UserEntityService handling of alsoKnownAs * fix: handle array-valued or unwrapped alsoKnownAs in ApPersonService * doc: note about bugfix for alsoKnownAs
This commit is contained in:
@@ -248,6 +248,16 @@ describe('UserEntityService', () => {
|
||||
expect(actual.achievements).toEqual(achievements);
|
||||
});
|
||||
|
||||
test('alsoKnownAs as string does not throw', async () => {
|
||||
const me = await createUser();
|
||||
const who = await createUser();
|
||||
|
||||
const whoWithStringAlsoKnownAs: MiUser = { ...who, alsoKnownAs: 'https://remote.example.com/users/alice' as any };
|
||||
|
||||
const actual = await service.pack(whoWithStringAlsoKnownAs, me, { schema: 'UserDetailedNotMe' }) as any;
|
||||
expect(Array.isArray(actual.alsoKnownAs)).toBe(true);
|
||||
});
|
||||
|
||||
describe('packManyによるpreloadがある時、preloadが無い時とpackの結果が同じになるか見たい', () => {
|
||||
test('no-preload', async() => {
|
||||
const me = await createUser();
|
||||
|
||||
Reference in New Issue
Block a user