Prevent duplicate hash channels

This commit is contained in:
Janez T
2026-03-13 18:46:33 +01:00
parent 11f3bf9f97
commit 40072175e3
2 changed files with 48 additions and 31 deletions

View File

@@ -17,5 +17,25 @@ void main() {
isTrue,
);
});
test('treats duplicate hashtag channels as conflicts', () {
expect(
ConnectionProvider.isDuplicateChannelName(
requestedName: '#sar',
existingName: '#sar',
),
isTrue,
);
});
test('allows private channels with the same name to coexist', () {
expect(
ConnectionProvider.isDuplicateChannelName(
requestedName: 'Ops',
existingName: 'Ops',
),
isFalse,
);
});
});
}