ThexXTURBOXx / flutter_web_auth_2

Flutter plugin for authenticating a user with a web service
https://pub.dev/packages/flutter_web_auth_2
MIT License
57 stars 55 forks source link

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

Open ChristianEdwardPadilla opened 2 months ago

ChristianEdwardPadilla commented 2 months ago

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

ThexXTURBOXx commented 2 months ago

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 :)