feat: Converted to ios models
This commit is contained in:
@@ -479,7 +479,7 @@ void main() {
|
||||
|
||||
final client = StreamChatClient('api-key', httpClient: mockDio);
|
||||
|
||||
expect(() => client.connectUserWithProvider(User(id: 'test-id')),
|
||||
expect(() => client.connectUserWithProvider(User.temp(id: 'test-id')),
|
||||
throwsA(isA<Exception>()));
|
||||
});
|
||||
|
||||
@@ -517,7 +517,7 @@ void main() {
|
||||
when(() => mockDio.interceptors).thenReturn(Interceptors());
|
||||
|
||||
final client = StreamChatClient('api-key', httpClient: mockDio);
|
||||
final user = User(id: 'test-id');
|
||||
final user = User.temp(id: 'test-id');
|
||||
final data = {
|
||||
'users': {user.id: user.toJson()},
|
||||
};
|
||||
@@ -542,8 +542,8 @@ void main() {
|
||||
when(() => mockDio.interceptors).thenReturn(Interceptors());
|
||||
|
||||
final client = StreamChatClient('api-key', httpClient: mockDio);
|
||||
final user = User(id: 'test-id');
|
||||
final user2 = User(id: 'test-id2');
|
||||
final user = User.temp(id: 'test-id');
|
||||
final user2 = User.temp(id: 'test-id2');
|
||||
|
||||
final data = {
|
||||
'users': {
|
||||
@@ -737,7 +737,13 @@ void main() {
|
||||
when(() => mockDio.interceptors).thenReturn(Interceptors());
|
||||
|
||||
final client = StreamChatClient('api-key', httpClient: mockDio);
|
||||
final message = Message(id: 'test', updatedAt: DateTime.now());
|
||||
final message = Message(
|
||||
id: 'test',
|
||||
updatedAt: DateTime.now(),
|
||||
createdAt: DateTime.now(),
|
||||
text: '',
|
||||
type: '',
|
||||
);
|
||||
|
||||
when(
|
||||
() => mockDio.post<String>(
|
||||
@@ -775,7 +781,7 @@ void main() {
|
||||
),
|
||||
);
|
||||
|
||||
await client.deleteMessage(Message(id: messageId));
|
||||
await client.deleteMessage(Message.temp(id: messageId, text: ''));
|
||||
|
||||
verify(() => mockDio.delete<String>('/messages/$messageId')).called(1);
|
||||
});
|
||||
@@ -1095,7 +1101,7 @@ void main() {
|
||||
);
|
||||
|
||||
test('should throw argument error', () {
|
||||
final message = Message(text: 'Hello');
|
||||
final message = Message.temp(text: 'Hello');
|
||||
expect(
|
||||
() => client.pinMessage(message, 'InvalidType'),
|
||||
throwsArgumentError,
|
||||
@@ -1104,7 +1110,7 @@ void main() {
|
||||
|
||||
test('should complete successfully', () async {
|
||||
const timeout = 30;
|
||||
final message = Message(text: 'Hello');
|
||||
final message = Message.temp(text: 'Hello');
|
||||
|
||||
when(
|
||||
() => mockDio.post<String>(
|
||||
@@ -1126,7 +1132,7 @@ void main() {
|
||||
});
|
||||
|
||||
test('should unpin message successfully', () async {
|
||||
final message = Message(text: 'Hello');
|
||||
final message = Message.temp(text: 'Hello');
|
||||
|
||||
when(
|
||||
() => mockDio.post<String>(
|
||||
|
||||
Reference in New Issue
Block a user