Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PSG-5279: Typo fix - MagicLink #85

Merged
merged 3 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ jobs:
id: install-simulator
uses: futureware-tech/simulator-action@v3
with:
model: 'iPhone 14'
model: 'iPhone 15'

- name: Run iOS tests
run: flutter test integration_test/*.dart -d ${{ steps.install-simulator.outputs.udid }} --dart-define=MAILOSAUR_API_KEY=${{ secrets.MAILOSAUR_API_KEY }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ void main() {
Future<void> loginWithMagicLink() async {
try {
await passage
.magliclink.login(IntegrationTestConfig.existingUserEmailMagicLink);
.magiclink.login(IntegrationTestConfig.existingUserEmailMagicLink);
await Future.delayed(const Duration(
milliseconds: IntegrationTestConfig.waitTimeMilliseconds));
final magicLinkStr = await MailosaurAPIClient.getMostRecentMagicLink();
if (magicLinkStr.isEmpty) {
fail('Test failed: Magic link is empty');
}
await passage.magliclink.activate(magicLinkStr);
await passage.magiclink.activate(magicLinkStr);
} catch (e) {
fail('Expected to activate login magic link, but got an exception: $e');
}
Expand Down
4 changes: 2 additions & 2 deletions integrationtestapp/integration_test/current_user_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ void main() {
Future<void> loginWithMagicLink() async {
try {
await passage
.magliclink
.magiclink
.login(IntegrationTestConfig.existingUserEmailMagicLink);
await Future.delayed(
const Duration(milliseconds: IntegrationTestConfig.waitTimeMilliseconds));
final magicLinkStr = await MailosaurAPIClient.getMostRecentMagicLink();
if (magicLinkStr.isEmpty) {
fail('Test failed: Magic link is empty');
}
await passage.magliclink.activate(magicLinkStr);
await passage.magiclink.activate(magicLinkStr);
} catch (e) {
fail('Expected to activate login magic link, but got an exception: $e');
}
Expand Down
26 changes: 13 additions & 13 deletions integrationtestapp/integration_test/magic_link_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ void main() {
final date = DateTime.now().millisecondsSinceEpoch;
final identifier =
'authentigator+$date@${MailosaurAPIClient.serverId}.mailosaur.net';
await passage.magliclink.register(identifier);
await passage.magiclink.register(identifier);
} catch (e) {
fail(
'Expected to send a register magic link, but got an exception: $e');
Expand All @@ -40,7 +40,7 @@ void main() {

test('testRegisterExistingUserMagicLink', () async {
try {
await passage.magliclink.register(
await passage.magiclink.register(
IntegrationTestConfig.existingUserEmailMagicLink);
fail('Expected PassageError but got success');
} catch (e) {
Expand All @@ -54,7 +54,7 @@ void main() {

test('testRegisterInvalidEmailAddressFormatMagicLink', () async {
try {
await passage.magliclink.register('invalid');
await passage.magiclink.register('invalid');
fail('Expected PassageError but got success');
} catch (e) {
if (e is PassageError) {
Expand All @@ -68,15 +68,15 @@ void main() {
test('testSendLoginMagicLink', () async {
try {
const identifier = IntegrationTestConfig.existingUserEmailMagicLink;
await passage.magliclink.login(identifier);
await passage.magiclink.login(identifier);
} catch (e) {
fail('Expected to send a login magic link, but got an exception: $e');
}
});

test('testInvalidLoginMagicLink', () async {
try {
await passage.magliclink.login('[email protected]');
await passage.magiclink.login('[email protected]');
fail('Expected PassageError but got success');
} catch (e) {
if (e is PassageError) {
Expand All @@ -92,14 +92,14 @@ void main() {
final date = DateTime.now().millisecondsSinceEpoch;
final identifier =
'authentigator+$date@${MailosaurAPIClient.serverId}.mailosaur.net';
await passage.magliclink.register(identifier);
await passage.magiclink.register(identifier);
await Future.delayed(const Duration(
milliseconds: IntegrationTestConfig.waitTimeMilliseconds));
final magicLinkStr = await MailosaurAPIClient.getMostRecentMagicLink();
if (magicLinkStr.isEmpty) {
fail('Test failed: Magic link is empty');
}
await passage.magliclink.activate(magicLinkStr);
await passage.magiclink.activate(magicLinkStr);
} catch (e) {
fail(
'Expected to activate register magic link, but got an exception: $e');
Expand All @@ -108,25 +108,25 @@ void main() {

test('testActivateLoginMagicLink', () async {
try {
await passage.magliclink.login(
await passage.magiclink.login(
IntegrationTestConfig.existingUserEmailMagicLink);
await Future.delayed(const Duration(
milliseconds: IntegrationTestConfig.waitTimeMilliseconds));
final magicLinkStr = await MailosaurAPIClient.getMostRecentMagicLink();
if (magicLinkStr.isEmpty) {
fail('Test failed: Magic link is empty');
}
await passage.magliclink.activate(magicLinkStr);
await passage.magiclink.activate(magicLinkStr);
} catch (e) {
fail('Expected to activate login magic link, but got an exception: $e');
}
});

test('testActivateInvalidMagicLink', () async {
try {
await passage.magliclink.register(
await passage.magiclink.register(
'authentigator+invalid@${MailosaurAPIClient.serverId}.mailosaur.net');
await passage.magliclink.activate('Invalid');
await passage.magiclink.activate('Invalid');
fail('Expected PassageError but got success');
} catch (e) {
if (e is PassageError) {
Expand All @@ -139,15 +139,15 @@ void main() {

test('testActivateDeactivatedUserMagicLink', () async {
try {
await passage.magliclink.login(
await passage.magiclink.login(
IntegrationTestConfig.deactivatedUserEmailMagicLink);
await Future.delayed(const Duration(
milliseconds: IntegrationTestConfig.waitTimeMilliseconds));
final magicLinkStr = await MailosaurAPIClient.getMostRecentMagicLink();
if (magicLinkStr.isEmpty) {
fail('Test failed: Magic link is empty');
}
await passage.magliclink.activate(magicLinkStr);
await passage.magiclink.activate(magicLinkStr);
fail('Expected PassageError but got success');
} catch (e) {
if (e is PassageError) {
Expand Down
4 changes: 2 additions & 2 deletions integrationtestapp/integration_test/token_store_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ void main() {
Future<void> loginWithMagicLink() async {
try {
await passage
.magliclink.login(IntegrationTestConfig.existingUserEmailMagicLink);
.magiclink.login(IntegrationTestConfig.existingUserEmailMagicLink);
await Future.delayed(const Duration(
milliseconds: IntegrationTestConfig.waitTimeMilliseconds));
final magicLinkStr = await MailosaurAPIClient.getMostRecentMagicLink();
if (magicLinkStr.isEmpty) {
fail('Test failed: Magic link is empty');
}
await passage.magliclink.activate(magicLinkStr);
await passage.magiclink.activate(magicLinkStr);
} catch (e) {
fail('Expected to activate login magic link, but got an exception: $e');
}
Expand Down
4 changes: 2 additions & 2 deletions lib/passage_flutter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class PassageFlutter {
late final PassagePasskey passkey;
late final PassageSocial social;
late final PassageOneTimePasscode oneTimePasscode;
late final PassageMagliclink magliclink;
late final PassageMagiclink magiclink;
late final PassageHosted hosted;
late final PassageApp app;
late final PassageTokenStore tokenStore;
Expand All @@ -22,7 +22,7 @@ class PassageFlutter {
passkey = PassagePasskey();
social = PassageSocial();
oneTimePasscode = PassageOneTimePasscode();
magliclink = PassageMagliclink();
magiclink = PassageMagiclink();
hosted = PassageHosted();
app =PassageApp();
tokenStore = PassageTokenStore();
Expand Down
2 changes: 1 addition & 1 deletion lib/passage_magliclink.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:passage_flutter/models/magic_link.dart';
import 'passage_flutter_models/auth_result.dart';
import 'passage_flutter_platform/passage_flutter_platform_interface.dart';

class PassageMagliclink {
class PassageMagiclink {

/// Creates and sends a new magic link for registration.
///
Expand Down
Loading