[tests][firestore] fix documentReference tests

This commit is contained in:
Salakar
2018-09-20 16:36:22 +01:00
parent 5c51407709
commit 75dc609047
2 changed files with 6 additions and 6 deletions

View File

@@ -3,7 +3,7 @@ const {
COL2_DOC_1,
COL2_DOC_1_ID,
COL2_DOC_1_PATH,
TEST2_COLLECTION_NAME,
TEST_COLLECTION_NAME_DYNAMIC,
resetTestCollectionDoc,
} = TestHelpers.firestore;
@@ -31,7 +31,7 @@ describe('firestore()', () => {
describe('parent', () => {
it('should return parent collection', () => {
const document = test2DocRef(COL2_DOC_1_ID);
document.parent.id.should.equal(TEST2_COLLECTION_NAME);
document.parent.id.should.equal(TEST_COLLECTION_NAME_DYNAMIC);
});
});

View File

@@ -60,6 +60,8 @@ module.exports = {
gaz: 12.1234567,
geopoint: new firebase.firestore.GeoPoint(0, 0),
naz: null,
arrNumber: [1, 2, 3, 4],
arrString: ['a', 'b', 'c', 'd'],
object: {
daz: 123,
},
@@ -115,7 +117,7 @@ module.exports = {
shouldCleanup = true;
return firebase
.firestore()
.collection(TEST_COLLECTION_NAME)
.collection(TEST_COLLECTION_NAME_DYNAMIC)
.doc(
docId.startsWith(testRunId) || docId.endsWith(testRunId)
? docId
@@ -127,7 +129,7 @@ module.exports = {
shouldCleanup = true;
return firebase
.firestore()
.collection(TEST2_COLLECTION_NAME)
.collection(TEST_COLLECTION_NAME_DYNAMIC)
.doc(
docId.startsWith(testRunId) || docId.endsWith(testRunId)
? docId
@@ -153,9 +155,7 @@ module.exports = {
async resetTestCollectionDoc(path, doc) {
shouldCleanup = true;
const _doc = doc || module.exports.COL_DOC_1();
await module.exports.cleanCollection(TEST_COLLECTION_NAME_DYNAMIC);
await firebase
.firestore()
.doc(path || module.exports.COL_DOC_1_PATH)