From d096d8008cd56480476b8305bee1a558e0b7f6e3 Mon Sep 17 00:00:00 2001 From: Tarekk Mohamed Abdalla Date: Thu, 7 Oct 2021 16:28:14 +0200 Subject: [PATCH 1/4] add signer test --- test/subsocial_sdk_test.dart | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/subsocial_sdk_test.dart b/test/subsocial_sdk_test.dart index 60aca99..65202e2 100644 --- a/test/subsocial_sdk_test.dart +++ b/test/subsocial_sdk_test.dart @@ -157,4 +157,13 @@ void main() { ); expect(reactionId, 32967); }); + + test('signer', () async { + final sdk = await Subsocial.instance; + final dummy = (await sdk.currentAccountId()).accountId; + expect(dummy, '3qMxrqpKLCvSBz943N5vEERRiyXBZFYySFwnBKXj7vA9W7ng'); + final account = await sdk.importAccount(suri: suri); + final signer = (await sdk.currentAccountId()).accountId; + expect(signer, account.publicKey); + }); } From a5a0aa39b36ce4b1fac131a22285289433404af9 Mon Sep 17 00:00:00 2001 From: Tarekk Mohamed Abdalla Date: Thu, 7 Oct 2021 17:29:33 +0200 Subject: [PATCH 2/4] clear signer before each test --- test/subsocial_sdk_test.dart | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/subsocial_sdk_test.dart b/test/subsocial_sdk_test.dart index 65202e2..ea8aa8c 100644 --- a/test/subsocial_sdk_test.dart +++ b/test/subsocial_sdk_test.dart @@ -6,6 +6,12 @@ import 'package:subsocial_sdk/subsocial_sdk.dart'; void main() { final suri = Platform.environment['SURI'] ?? '//Alice'; + + setUp(() async { + final sdk = await Subsocial.instance; + sdk.clearSigner(); + }); + test('Get Space with Id', () async { final sdk = await Subsocial.instance; final space = await sdk.spaceById(1); From 446f56b01408ae218a51879dcd27327437298381 Mon Sep 17 00:00:00 2001 From: Tarekk Mohamed Abdalla Date: Thu, 7 Oct 2021 17:33:46 +0200 Subject: [PATCH 3/4] skip signer test --- test/subsocial_sdk_test.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/subsocial_sdk_test.dart b/test/subsocial_sdk_test.dart index ea8aa8c..cf6237c 100644 --- a/test/subsocial_sdk_test.dart +++ b/test/subsocial_sdk_test.dart @@ -171,5 +171,5 @@ void main() { final account = await sdk.importAccount(suri: suri); final signer = (await sdk.currentAccountId()).accountId; expect(signer, account.publicKey); - }); + }, skip: true); } From 693b12183da4438aeeaf458fa8fbadfb2c80a4a1 Mon Sep 17 00:00:00 2001 From: Tarekk Mohamed Abdalla Date: Thu, 21 Oct 2021 18:33:56 +0200 Subject: [PATCH 4/4] fix test --- test/subsocial_sdk_test.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/subsocial_sdk_test.dart b/test/subsocial_sdk_test.dart index ddc6cfe..6b14fdb 100644 --- a/test/subsocial_sdk_test.dart +++ b/test/subsocial_sdk_test.dart @@ -9,7 +9,7 @@ void main() { setUp(() async { final sdk = await Subsocial.instance; - await sdk.clearSigner(); + sdk.clearSigner(); }); test('Get Space with Id', () async {