flutter_web_auth_2 icon indicating copy to clipboard operation
flutter_web_auth_2 copied to clipboard

[Bug]: Dart API tests are failing (and meaningless)

Open ChristianEdwardPadilla opened this issue 1 year ago • 1 comments
trafficstars

Description

The Dart API tests for this plugin (located here: https://github.com/ThexXTURBOXx/flutter_web_auth_2/blob/master/flutter_web_auth_2/test/flutter_web_auth_2_test.dart) have a couple problems:

  1. The 'invalid scheme' test fails.
  2. The tests are inherently meaningless because they only test the mock defined in the setUp call.

Minimal Reproduction

To reproduce: run the tests.

Exception or Error

Expected: throws <Instance of 'ArgumentError'>
Actual: <Instance of 'Future<String>'>
   Which: threw PlatformException:<PlatformException(error, Expected: 'foobar'
                  Actual: 'foobar://test'
                   Which: is different. Both strings start the same, but the actual value also has the following trailing characters: ://test
                , null, null)>

Expected Behaviour

The tests should pass and they should verify the behavior of the actual implementation, not a mock.

Screenshots

No response

Additional context

No response

Device

NA

OS

NA

Browser

NA

Flutter version

NA

flutter_web_auth_2 version

NA

Checklist

  • [X] I have read and followed the entire troubleshooting guide and it has not provided the solution I need.
  • [X] I have provided all the information I can.

ChristianEdwardPadilla avatar Sep 26 '24 18:09 ChristianEdwardPadilla

Thanks for the bug report! Yes, indeed, I am not really using the tests and hence barely edit/update them. They are also not really important when it comes to this package. Far more important is the example (which acts as a sort of manual integration test). Maybe, I will fix the tests at some point, but they really have a low priority for me at least :)

ThexXTURBOXx avatar Sep 26 '24 19:09 ThexXTURBOXx