Skip to content

Commit

Permalink
skip test on web for unauthed user failing cors
Browse files Browse the repository at this point in the history
  • Loading branch information
Equartey committed Jul 16, 2024
1 parent 64896ee commit 860c25c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 205 deletions.
2 changes: 1 addition & 1 deletion infra-gen2/backends/api/api-multi-auth/amplify/backend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ backend.auth.resources.unauthenticatedUserIamRole.attachInlinePolicy(
backend.addOutput({
custom: {
[myRestApi.restApiName]: {
url: myRestApi.url,
url: myRestApi.url.replace(/\/+$/, ""),
aws_region: Stack.of(myRestApi).region,
authorization_type: AuthorizationType.IAM,
},
Expand Down

This file was deleted.

20 changes: 12 additions & 8 deletions packages/api/amplify_api/example/integration_test/rest_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,18 @@ void main({bool useExistingTestUser = false}) {
skip: zIsWeb,
);

testWidgets('should throw a HttpStatusException for POST',
(WidgetTester tester) async {
final operation = Amplify.API.post(path);
await expectLater(
operation.response,
throwsA(isA<HttpStatusException>()),
);
});
testWidgets(
'should throw a HttpStatusException for POST',
(WidgetTester tester) async {
final operation = Amplify.API.post(path);
await expectLater(
operation.response,
throwsA(isA<HttpStatusException>()),
);
},
// Skip on web because CORS
skip: zIsWeb,
);
});

group('authorized user access', () {
Expand Down

0 comments on commit 860c25c

Please sign in to comment.