From 972b023ab4667eda237d215ce2d573c97150ad31 Mon Sep 17 00:00:00 2001 From: canewsin Date: Sun, 5 Mar 2023 23:07:39 +0530 Subject: [PATCH] v1.1.0 --- CHANGELOG.md | 4 ++++ pubspec.yaml | 4 ++-- test/admin_test.dart | 2 +- test/plugins_test.dart | 29 +++++++++++++++++++---------- 4 files changed, 26 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 02c50b7..1d9bf02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## [1.1.0] + - Several API Fixes to match with backend + - Add tests for all available cmds + ## [1.0.0] - Implemented Full Core & Main Plugin API with Proper return type - Full Changelog https://github.com/ZeroNetX/zeronet_ws/compare/4e97bfb7...73e9d309 diff --git a/pubspec.yaml b/pubspec.yaml index b061ed5..f3d1f1c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: zeronet_ws description: ZeroNet(X) WebSocket Package to use ZeroNet API via Websockets in your dart program. -version: 1.0.0 +version: 1.1.0 homepage: https://github.com/canewsin/zeronet_ws environment: @@ -15,7 +15,7 @@ dependencies: plugin_platform_interface: ^2.0.2 js: ^0.6.4 - html: 0.15.1 + html: ^0.15.1 http: ^0.13.3 web_socket_channel: ^2.1.0 diff --git a/test/admin_test.dart b/test/admin_test.dart index 2a12fcb..4472d4b 100644 --- a/test/admin_test.dart +++ b/test/admin_test.dart @@ -6,7 +6,7 @@ import 'package:zeronet_ws/zeronet_ws.dart'; void main() { const dashboard = '1HELLoE3sFD9569CLCbHEAVqvqV7U2Ri9d'; const talk = '1TaLkFrMwvbNsooF4ioKAY9EuxTBTjipT'; - const testSite = '1DCN2A5VqYrQSNds7Y3s9JLn65CfykPKJw'; + // const testSite = '1DCN2A5VqYrQSNds7Y3s9JLn65CfykPKJw'; final instance = ZeroNet.instance; test('Admin::as', () async { diff --git a/test/plugins_test.dart b/test/plugins_test.dart index b1f7e90..06ef2ea 100644 --- a/test/plugins_test.dart +++ b/test/plugins_test.dart @@ -128,37 +128,45 @@ void main() { assert(false); // unathorized await instance.connect(talk); final res = await instance.siteblockAddFuture( - '1EjitdTHErKQccRVyfvgharFc15wVpbS2j', - reason: "testing"); + '1EjitdTHErKQccRVyfvgharFc15wVpbS2j', + reason: "testing", + ); + assert(res.result != null); }); test("siteblockRemoveFuture", () async { assert(false); // unathorized await instance.connect(talk); final res = await instance.siteblockRemoveFuture( - '1EjitdTHErKQccRVyfvgharFc15wVpbS2j', - reason: "testing"); + '1EjitdTHErKQccRVyfvgharFc15wVpbS2j', + reason: "testing", + ); + assert(res.result != null); }); test("siteblockListFuture", () async { assert(false); // unathorized await instance.connect(talk); final res = await instance.siteblockListFuture(); + assert(res.result != null); }); test("siteblockGetFuture", () async { assert(false); // unathorized await instance.connect(talk); - final res = await instance - .siteblockGetFuture('1EjitdTHErKQccRVyfvgharFc15wVpbS2j'); + final res = await instance.siteblockGetFuture( + '1EjitdTHErKQccRVyfvgharFc15wVpbS2j', + ); + assert(res.result != null); }); }); group('Plugin::Cors', () { test("corsPermissionFuture", () async { await instance.connect(talk); - final res = await instance - .corsPermissionFuture(["cors-15UYrA7aXr2Nto1Gg4yWXpY3EAJwafMTNk"]); + final res = await instance.corsPermissionFuture([ + "cors-15UYrA7aXr2Nto1Gg4yWXpY3EAJwafMTNk", + ]); assert(res.prompt != null); @@ -193,7 +201,7 @@ void main() { assert(encryptStr.result is String); final res = await instance.eciesDecryptFuture(encryptStr.result); final deCrypt = res.result; - assert(res.result == text); + assert(deCrypt == text); }); test("aesEncryptFuture", () async { @@ -382,6 +390,7 @@ void main() { await instance.connect(storageAdd); assert(false); final res = await instance.optionalLimitStatsFuture(); + assert(res.result != null); }); test('optionalLimitSetFuture', () async { @@ -389,6 +398,7 @@ void main() { await instance.connect(storageAdd); final res = await instance.optionalLimitSetFuture(); + assert(res.result != null); }); /// enabled auto downlaoded feature to the provided directory @@ -406,7 +416,6 @@ void main() { await instance.connect(storageAdd); final res = await instance.optionalHelpListFuture(); - print(res.result.toString()); assert(res.result is Map); });