Skip to content

PR feedback from #105 #106

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

Merged
merged 1 commit into from
Jul 15, 2021
Merged
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
18 changes: 8 additions & 10 deletions spec/providers/firestore.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import { expect } from 'chai';
import * as firebase from 'firebase-admin';
import { FeaturesList } from '../../src/features';
import fft = require('../../src/index');

describe('providers/firestore', () => {
it('produces the right snapshot with makeDocumentSnapshot', async () => {
const test = fft();
let test: FeaturesList;

beforeEach(() => {
test = fft();
});

it('produces the right snapshot with makeDocumentSnapshot', async () => {
const snapshot = test.firestore.makeDocumentSnapshot(
{
email_address: '[email protected]',
Expand All @@ -20,8 +25,6 @@ describe('providers/firestore', () => {
});

it('should allow empty document in makeDocumentSnapshot', async () => {
const test = fft();

const snapshot = test.firestore.makeDocumentSnapshot(
{},
'collection/doc-id'
Expand All @@ -32,8 +35,6 @@ describe('providers/firestore', () => {
});

it('should allow geopoints with makeDocumentSnapshot', () => {
const test = fft();

const hq = new firebase.firestore.GeoPoint(47.6703, 122.1971);
const snapshot = test.firestore.makeDocumentSnapshot(
{ geopoint: hq },
Expand All @@ -43,9 +44,7 @@ describe('providers/firestore', () => {
expect(snapshot.data()).to.deep.equal({ geopoint: hq });
});

it('should allow timestmaps with makeDocumentSnapshot', () => {
const test = fft();

it('should allow timestamps with makeDocumentSnapshot', () => {
const time = new Date();
const snapshot = test.firestore.makeDocumentSnapshot(
{ time },
Expand All @@ -57,7 +56,6 @@ describe('providers/firestore', () => {
});

it('should allow references with makeDocumentSnapshot', () => {
const test = fft();
firebase.initializeApp({
projectId: 'not-a-project',
});
Expand Down