Browse Source

test(nextcloud): Test client login flow V2

Signed-off-by: jld3103 <jld3103yt@gmail.com>
pull/868/head
jld3103 1 year ago
parent
commit
63cd10ac49
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 15
      packages/nextcloud/test/core_test.dart

15
packages/nextcloud/test/core_test.dart

@ -184,6 +184,21 @@ void main() {
expect(response.body.ocs.data.entries.single.rounded, isFalse);
expect(response.body.ocs.data.entries.single.attributes, isEmpty);
});
test('Client login flow V2', () async {
final response = await client.core.clientFlowLoginV2.init();
expect(response.statusCode, 200);
expect(() => response.headers, isA<void>());
expect(response.body.login, startsWith('http://localhost'));
expect(response.body.poll.endpoint, startsWith('http://localhost'));
expect(response.body.poll.token, isNotEmpty);
expect(
() => client.core.clientFlowLoginV2.poll(token: response.body.poll.token),
throwsA(predicate<DynamiteApiException>((final e) => e.statusCode == 404)),
);
});
},
retry: retryCount,
timeout: timeout,

Loading…
Cancel
Save