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

Fix FieldValue equality #251

Merged
merged 2 commits into from Nov 29, 2022
Merged

Fix FieldValue equality #251

merged 2 commits into from Nov 29, 2022

Conversation

Zohenn
Copy link
Contributor

@Zohenn Zohenn commented Nov 11, 2022

Base library makes it possible to compare FieldValue.delete() and FieldValue.serverTimestamp(). The moment you call FakeFirebaseFirestore() it stops working, because it overwrites global FieldValueFactoryPlatform.instance with MockFieldValueFactoryPlatform.

I added a test, it's basically the same as that one:
https://github.com/firebase/flutterfire/blob/cbb24aca7b1cfb264005e069e4377710a0f7b67f/packages/cloud_firestore/cloud_firestore/test/field_value_test.dart

@@ -534,6 +534,16 @@ void main() {
});

group('FieldValue', () {
test('Equality', () {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind adding the permalink to the source tests? This way we can easily adapt if they change their tests in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, will do.

@atn832
Copy link
Owner

atn832 commented Nov 29, 2022

Looks good. I'll just merge now. Feel free to add the permalink comment in a separate PR.

@atn832 atn832 merged commit 8b5b62e into atn832:master Nov 29, 2022
@Zohenn Zohenn deleted the field_value_equality branch November 29, 2022 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants