TF-4404 Keep automation keys stable across enum renames.
This commit is contained in:
@@ -17,6 +17,8 @@ class MailToAttendeesEventEmailScenario extends BaseTestScenario
|
|||||||
with OpenCalendarEventScenarioMixin {
|
with OpenCalendarEventScenarioMixin {
|
||||||
const MailToAttendeesEventEmailScenario(super.$);
|
const MailToAttendeesEventEmailScenario(super.$);
|
||||||
|
|
||||||
|
static const _expectedEventTitle = 'Come for a chat';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<void> runTestLogic() async {
|
Future<void> runTestLogic() async {
|
||||||
final threadRobot = ThreadRobot($);
|
final threadRobot = ThreadRobot($);
|
||||||
@@ -51,7 +53,7 @@ class MailToAttendeesEventEmailScenario extends BaseTestScenario
|
|||||||
final actualSubject = composerController.subjectEmail.value ?? '';
|
final actualSubject = composerController.subjectEmail.value ?? '';
|
||||||
|
|
||||||
final expectedSubject = EmailUtils.applyPrefix(
|
final expectedSubject = EmailUtils.applyPrefix(
|
||||||
subject: 'Come for a chat',
|
subject: _expectedEventTitle,
|
||||||
defaultPrefix: EmailUtils.defaultReplyPrefix,
|
defaultPrefix: EmailUtils.defaultReplyPrefix,
|
||||||
localizedPrefix: appLocalizations.prefix_reply_email,
|
localizedPrefix: appLocalizations.prefix_reply_email,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -24,7 +24,20 @@ enum EventActionType {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Key getKeyButton() => Key('${name}_event_action_button');
|
Key getKeyButton() {
|
||||||
|
switch (this) {
|
||||||
|
case EventActionType.yes:
|
||||||
|
return const Key('yes_event_action_button');
|
||||||
|
case EventActionType.acceptCounter:
|
||||||
|
return const Key('acceptCounter_event_action_button');
|
||||||
|
case EventActionType.maybe:
|
||||||
|
return const Key('maybe_event_action_button');
|
||||||
|
case EventActionType.no:
|
||||||
|
return const Key('no_event_action_button');
|
||||||
|
case EventActionType.mailToAttendees:
|
||||||
|
return const Key('mailToAttendees_event_action_button');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
String getToastMessageSuccess(BuildContext context) {
|
String getToastMessageSuccess(BuildContext context) {
|
||||||
switch(this) {
|
switch(this) {
|
||||||
|
|||||||
@@ -184,6 +184,19 @@ void main() {
|
|||||||
equals(' Re: Hello'),
|
equals(' Re: Hello'),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test(
|
||||||
|
'should add a standardized prefix for a legacy NBSP variant',
|
||||||
|
() {
|
||||||
|
expect(
|
||||||
|
EmailUtils.applyPrefix(
|
||||||
|
subject: 'Re\u00A0: Hello',
|
||||||
|
defaultPrefix: EmailUtils.defaultReplyPrefix,
|
||||||
|
),
|
||||||
|
equals('Re: Re\u00A0: Hello'),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user