Skip to content

Commit 5ece546

Browse files
committed
chore(analytics): clean files
Run mono_repo generate Minor fixes fix lint.yml
1 parent 9d1a95c commit 5ece546

File tree

21 files changed

+113
-434
lines changed

21 files changed

+113
-434
lines changed

.github/workflows/lint.yml

Lines changed: 76 additions & 50 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/amplify/amplify_flutter/lib/src/method_channel_amplify.dart

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,4 @@ class MethodChannelAmplify extends AmplifyClassImpl {
119119
}
120120
}
121121
}
122-
123-
@override
124-
Future<void> reset() async {
125-
Auth.reset();
126-
Analytics.reset();
127-
Storage.reset();
128-
DataStore.reset();
129-
API.reset();
130-
}
131122
}

packages/amplify/amplify_flutter/test/amplify_test.dart

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@
1313
* permissions and limitations under the License.
1414
*/
1515

16-
import 'package:amplify_analytics_pinpoint/method_channel_amplify.dart';
16+
import 'package:amplify_datastore/amplify_datastore.dart';
1717
import 'package:amplify_flutter/amplify_flutter.dart';
1818
import 'package:amplify_flutter/src/amplify_impl.dart';
19+
import 'package:amplify_test/test_models/ModelProvider.dart';
1920
import 'package:flutter/services.dart';
2021
import 'package:flutter_test/flutter_test.dart';
2122

@@ -24,10 +25,8 @@ void main() {
2425
Amplify = MethodChannelAmplify();
2526

2627
const MethodChannel channel = MethodChannel('com.amazonaws.amplify/amplify');
27-
const MethodChannel storageChannel =
28-
MethodChannel('com.amazonaws.amplify/storage_s3');
29-
const MethodChannel analyticsChannel =
30-
MethodChannel('com.amazonaws.amplify/analytics_pinpoint');
28+
const MethodChannel dataStoreChannel =
29+
MethodChannel('com.amazonaws.amplify/datastore');
3130
var platformConfigured = false;
3231

3332
// Test data
@@ -61,27 +60,23 @@ void main() {
6160
throw PlatformException(code: 'AmplifyAlreadyConfiguredException');
6261
}
6362
});
64-
storageChannel.setMockMethodCallHandler((MethodCall methodCall) async {
65-
return true;
66-
});
67-
analyticsChannel.setMockMethodCallHandler((MethodCall methodCall) async {
63+
dataStoreChannel.setMockMethodCallHandler((MethodCall methodCall) async {
6864
return true;
6965
});
7066
// We want to instantiate a new instance for each test so we start
7167
// with a fresh state as `Amplify` singleton holds a state.
7268
amplify = MethodChannelAmplify();
7369
AmplifyClass.instance = amplify;
7470

75-
// We only use Auth and Analytics category for testing this class.
71+
// We only use Auth and DataStore category for testing this class.
7672
// Clear out their plugins before each test for a fresh state.
7773
Amplify.Auth.reset();
78-
Amplify.Analytics.reset();
74+
Amplify.DataStore.reset();
7975
});
8076

8177
tearDown(() {
8278
channel.setMockMethodCallHandler(null);
83-
storageChannel.setMockMethodCallHandler(null);
84-
analyticsChannel.setMockMethodCallHandler(null);
79+
dataStoreChannel.setMockMethodCallHandler(null);
8580
});
8681

8782
test('before calling configure, isConfigure should be false', () {
@@ -132,39 +127,44 @@ void main() {
132127
test('adding multiple plugins using addPlugins method doesn\'t throw',
133128
() async {
134129
await amplify.addPlugins([
135-
AmplifyAnalyticsPinpointMethodChannel(),
136-
AmplifyAnalyticsPinpointMethodChannel(),
130+
AmplifyDataStore(modelProvider: ModelProvider.instance),
131+
AmplifyDataStore(modelProvider: ModelProvider.instance),
137132
]);
138133
await amplify.configure(validJsonConfiguration);
139134
expect(amplify.isConfigured, true);
140135
});
141136

142137
test('adding single plugins using addPlugin method doesn\'t throw', () async {
143-
await amplify.addPlugin(AmplifyAnalyticsPinpointMethodChannel());
138+
await amplify
139+
.addPlugin(AmplifyDataStore(modelProvider: ModelProvider.instance));
144140
await amplify.configure(validJsonConfiguration);
145141
expect(amplify.isConfigured, true);
146142
});
147143

148144
test('adding multiple plugins from same Analytic category throws exception',
149145
() async {
150-
await amplify.addPlugin(AmplifyAnalyticsPinpointMethodChannel());
146+
await amplify
147+
.addPlugin(AmplifyDataStore(modelProvider: ModelProvider.instance));
151148
expect(
152-
amplify.addPlugin(AmplifyAnalyticsPinpointMethodChannel()),
149+
amplify
150+
.addPlugin(AmplifyDataStore(modelProvider: ModelProvider.instance)),
153151
throwsA(
154152
isA<AmplifyException>().having(
155153
(e) => e.toString(),
156154
'toString',
157-
contains('Analytics plugin has already been added'),
155+
contains('DataStore plugin has already been added'),
158156
),
159157
),
160158
);
161159
});
162160

163161
test('adding plugins after configure throws an exception', () async {
164-
await amplify.addPlugin(AmplifyAnalyticsPinpointMethodChannel());
162+
await amplify
163+
.addPlugin(AmplifyDataStore(modelProvider: ModelProvider.instance));
165164
await amplify.configure(validJsonConfiguration);
166165
try {
167-
await amplify.addPlugin(AmplifyAnalyticsPinpointMethodChannel());
166+
await amplify
167+
.addPlugin(AmplifyDataStore(modelProvider: ModelProvider.instance));
168168
} catch (e) {
169169
expect(e, amplifyAlreadyConfiguredForAddPluginException);
170170
expect(amplify.isConfigured, true);

packages/analytics/amplify_analytics_pinpoint/example/macos/Runner.xcodeproj/project.pbxproj

Lines changed: 1 addition & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/analytics/amplify_analytics_pinpoint/example/web/index.html

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
</head>
88

99
<body>
10-
<!-- Added for Drift web setup: https://drift.simonbinder.eu/web/ -->
11-
<script defer src="sql-wasm.js"></script>
12-
1310
<script src="main.dart.js" type="application/javascript"></script>
1411
</body>
1512

0 commit comments

Comments
 (0)