Skip to content

Commit

Permalink
v1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
canewsin committed Mar 5, 2023
1 parent b4c57cf commit 972b023
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 13 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion test/admin_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
29 changes: 19 additions & 10 deletions test/plugins_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -382,13 +390,15 @@ void main() {
await instance.connect(storageAdd);
assert(false);
final res = await instance.optionalLimitStatsFuture();
assert(res.result != null);
});

test('optionalLimitSetFuture', () async {
assert(false); // how to pass argument ??
await instance.connect(storageAdd);

final res = await instance.optionalLimitSetFuture();
assert(res.result != null);
});

/// enabled auto downlaoded feature to the provided directory
Expand All @@ -406,7 +416,6 @@ void main() {
await instance.connect(storageAdd);

final res = await instance.optionalHelpListFuture();
print(res.result.toString());
assert(res.result is Map);
});

Expand Down

0 comments on commit 972b023

Please sign in to comment.