|
4 | 4 |
|
5 | 5 | import 'package:_pub_shared/data/admin_api.dart'; |
6 | 6 | import 'package:clock/clock.dart'; |
7 | | -import 'package:pub_dev/account/backend.dart'; |
8 | 7 | import 'package:pub_dev/package/backend.dart'; |
9 | 8 | import 'package:pub_dev/package/models.dart'; |
10 | | -import 'package:pub_dev/publisher/backend.dart'; |
11 | 9 | import 'package:pub_dev/shared/datastore.dart'; |
12 | 10 | import 'package:test/test.dart'; |
13 | 11 |
|
@@ -41,74 +39,6 @@ void main() { |
41 | 39 | }); |
42 | 40 | }); |
43 | 41 |
|
44 | | - testWithProfile( |
45 | | - 'creating, listing members and deleting publisher with no packages', |
46 | | - fn: () async { |
47 | | - final client = createPubApiClient(authToken: siteAdminToken); |
48 | | - final p0 = await publisherBackend.getPublisher('other.com'); |
49 | | - expect(p0, isNull); |
50 | | - final rs1 = await client.adminInvokeAction( |
51 | | - 'publisher-create', |
52 | | - AdminInvokeActionArguments(arguments: { |
53 | | - 'publisher': 'other.com', |
54 | | - 'member-email': 'user@pub.dev', |
55 | | - }), |
56 | | - ); |
57 | | - expect(rs1.output, { |
58 | | - 'message': 'Publisher created.', |
59 | | - 'publisherId': 'other.com', |
60 | | - 'member-email': 'user@pub.dev', |
61 | | - }); |
62 | | - final publisherMembersResponse = await client.adminInvokeAction( |
63 | | - 'publisher-members-list', |
64 | | - AdminInvokeActionArguments(arguments: { |
65 | | - 'publisher': 'other.com', |
66 | | - }), |
67 | | - ); |
68 | | - expect(publisherMembersResponse.output, { |
69 | | - 'publisher': 'other.com', |
70 | | - 'description': '', |
71 | | - 'website': 'https://other.com/', |
72 | | - 'contact': 'user@pub.dev', |
73 | | - 'created': isA<String>(), |
74 | | - 'members': [ |
75 | | - {'email': 'user@pub.dev', 'role': 'admin', 'userId': isA<String>()} |
76 | | - ] |
77 | | - }); |
78 | | - final p1 = await publisherBackend.getPublisher('other.com'); |
79 | | - expect(p1, isNotNull); |
80 | | - final rs2 = await client.adminInvokeAction('publisher-delete', |
81 | | - AdminInvokeActionArguments(arguments: {'publisher': 'other.com'})); |
82 | | - expect(rs2.output, { |
83 | | - 'message': 'Publisher and all members deleted.', |
84 | | - 'publisherId': 'other.com', |
85 | | - 'members-count': 1, |
86 | | - }); |
87 | | - final p2 = await publisherBackend.getPublisher('other.com'); |
88 | | - expect(p2, isNull); |
89 | | - }); |
90 | | - |
91 | | - testWithProfile('remove package from publisher', fn: () async { |
92 | | - final api = createPubApiClient(authToken: siteAdminToken); |
93 | | - final result = await api.adminInvokeAction( |
94 | | - 'publisher-package-remove', |
95 | | - AdminInvokeActionArguments(arguments: {'package': 'neon'}), |
96 | | - ); |
97 | | - final neon = await packageBackend.lookupPackage('neon'); |
98 | | - |
99 | | - expect(result.output, { |
100 | | - 'previousPublisher': 'example.com', |
101 | | - 'package': 'neon', |
102 | | - 'uploaders': [ |
103 | | - {'email': 'admin@pub.dev', 'userId': neon!.uploaders!.first} |
104 | | - ] |
105 | | - }); |
106 | | - final packagePublisherInfo = await packageBackend.getPublisherInfo('neon'); |
107 | | - expect(packagePublisherInfo.publisherId, isNull); |
108 | | - final emails = await accountBackend.getEmailsOfUserIds(neon.uploaders!); |
109 | | - expect(emails, {'admin@pub.dev'}); |
110 | | - }); |
111 | | - |
112 | 42 | testWithProfile('user-info', fn: () async { |
113 | 43 | final api = createPubApiClient(authToken: siteAdminToken); |
114 | 44 | final result = await api.adminInvokeAction( |
@@ -179,34 +109,4 @@ void main() { |
179 | 109 | .uploadPackageBytes(bytes); |
180 | 110 | expect(rs2.success.message, contains('Successfully uploaded')); |
181 | 111 | }); |
182 | | - |
183 | | - testWithProfile('package-version-retraction', fn: () async { |
184 | | - final latest = await packageBackend.getLatestVersion('oxygen'); |
185 | | - |
186 | | - final api = createPubApiClient(authToken: siteAdminToken); |
187 | | - final result = await api.adminInvokeAction( |
188 | | - 'package-version-retraction', |
189 | | - AdminInvokeActionArguments(arguments: { |
190 | | - 'package': 'oxygen', |
191 | | - 'version': latest!, |
192 | | - 'set-retracted': 'true', |
193 | | - }), |
194 | | - ); |
195 | | - |
196 | | - expect(result.output, { |
197 | | - 'before': { |
198 | | - 'package': 'oxygen', |
199 | | - 'version': latest, |
200 | | - 'isRetracted': false, |
201 | | - }, |
202 | | - 'after': { |
203 | | - 'package': 'oxygen', |
204 | | - 'version': latest, |
205 | | - 'isRetracted': true, |
206 | | - }, |
207 | | - }); |
208 | | - |
209 | | - final newLatest = await packageBackend.getLatestVersion('oxygen'); |
210 | | - expect(newLatest != latest, isTrue); |
211 | | - }); |
212 | 112 | } |
0 commit comments