@@ -241,6 +241,30 @@ describe('ScryingPoolStrip', () => {
|
||||
const data = strip.getData();
|
||||
expect(data.hasStreamAccess).toBe(false);
|
||||
});
|
||||
|
||||
it('includes current user when showGMSelfFeed is true', () => {
|
||||
adapter.settings = { get: vi.fn(() => true) };
|
||||
adapter.users.all.mockReturnValue([{ id: 'u1' }, { id: 'u2' }]);
|
||||
const data = strip.getData();
|
||||
expect(data.participants.map(p => p.userId)).toContain('u1');
|
||||
expect(data.participants.map(p => p.userId)).toContain('u2');
|
||||
});
|
||||
|
||||
it('excludes current user when showGMSelfFeed is false', () => {
|
||||
adapter.settings = { get: vi.fn(() => false) };
|
||||
adapter.users.all.mockReturnValue([{ id: 'u1' }, { id: 'u2' }]);
|
||||
const data = strip.getData();
|
||||
// u1 is the current user (mocked in beforeEach), should be excluded
|
||||
expect(data.participants.map(p => p.userId)).not.toContain('u1');
|
||||
expect(data.participants.map(p => p.userId)).toContain('u2');
|
||||
});
|
||||
|
||||
it('includes all users when settings is unavailable (defaults to true)', () => {
|
||||
// no adapter.settings — fallback to true
|
||||
adapter.users.all.mockReturnValue([{ id: 'u1' }, { id: 'u2' }]);
|
||||
const data = strip.getData();
|
||||
expect(data.participants.length).toBe(2);
|
||||
});
|
||||
});
|
||||
|
||||
describe('_attachVideoStream() (Story 5.1)', () => {
|
||||
|
||||
Reference in New Issue
Block a user