I'm writing a flutter app which uses Supabase as its backend. I'm using the bucket and messaging functionalities the following way:
await Supabase.initialize(
url: dotenv.get('SUPABASE_URL'),
anonKey: dotenv.get('SUPABASE_ANON_KEY', fallback: ''),
debug: false);
FirebaseMessaging messaging = FirebaseMessaging.instance;
NotificationSettings settings = await messaging.requestPermission(
alert: true,
announcement: false,
badge: true,
carPlay: false,
criticalAlert: false,
provisional: false,
sound: true,
);
...
final downloadedTraining = await Supabase.instance.client.storage
.from('general')
.getPublicUrl('trainings/2023-04-17.pdf');
...
final dt = await Supabase.instance.client.storage
.from('general')
.download('/trainings/2023-04-17.pdf');
...
And now I would like to mock the storage in order to always return an expected result when performing the e-2-e tests with patrol.
Is it possible mocking just what I need i.e. storage.from('...').download
? How can I achieve it?