File tree Expand file tree Collapse file tree 5 files changed +47
-2
lines changed
Expand file tree Collapse file tree 5 files changed +47
-2
lines changed Original file line number Diff line number Diff line change 22.dart_tool /
33.packages
44.flutter-plugins
5+ .idea /
56
67# Conventional directory for build outputs.
78build /
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ In your flutter project add the dependency:
1515``` dart
1616dependencies:
1717 ...
18- shopify : ^1.0.0
18+ woosignal_shopify : ^1.0.0
1919```
2020
2121### Usage example #
Original file line number Diff line number Diff line change 1+ tags :
2+ products :
3+ get-products:
Original file line number Diff line number Diff line change @@ -57,6 +57,17 @@ class ApiProvider {
5757 "api_version" : "$_version /v1" ,
5858 "sdk_name" : "woosignal-shopify"
5959 };
60+ } else if (Platform .environment.containsKey ('FLUTTER_TEST' )) {
61+ _deviceMeta = {
62+ "model" : 'X Model' ,
63+ "brand" : 'X Brand' ,
64+ "manufacturer" : "X Manufacturer" ,
65+ "version" : 'X Version' ,
66+ "uuid" : '1234567890' ,
67+ "platform_type" : "testing" ,
68+ "api_version" : "$_version /v1" ,
69+ "sdk_name" : "woosignal-shopify"
70+ };
6071 }
6172 }
6273
Original file line number Diff line number Diff line change 1- void main () {}
1+ import 'package:flutter/material.dart' ;
2+ import 'package:shared_preferences/shared_preferences.dart' ;
3+ import 'package:test/test.dart' ;
4+ import 'package:woosignal_shopify/models/response/products_response.dart' ;
5+ import 'package:woosignal_shopify/woosignal_shopify.dart' ;
6+
7+ void main () {
8+ WidgetsFlutterBinding .ensureInitialized ();
9+ SharedPreferences .setMockInitialValues ({});
10+
11+ setUp (() async {
12+ await WooSignal .instance.init (
13+ appKey: "app_affb6434339b34443a297c2e40a3edab7102137e6d67de9abfe612b749bd" ,
14+ debugMode: false ,
15+ );
16+ });
17+
18+ group ('Testing Shopify Products' , () {
19+
20+ test ('get products' , () async {
21+
22+ ProductsResponse ? productsResponse = await WooSignal .instance.getProducts ();
23+
24+ expect (productsResponse is ProductsResponse , true );
25+
26+ expect (productsResponse? .products! .isNotEmpty, true );
27+
28+ }, tags: ['get-products' ]);
29+
30+ }, tags: ['products' ]);
31+ }
You can’t perform that action at this time.
0 commit comments