[tests][firestore] added large and small sized blob read/write tests

This commit is contained in:
Salakar 2018-05-03 21:02:07 +01:00
parent 912335062a
commit 93dc585ac3
1 changed files with 20 additions and 2 deletions

View File

@ -91,9 +91,9 @@ describe('firestore', () => {
* USAGE TESTS
* -----------------*/
describe.only('firestore', () => {
describe('firestore', () => {
describe('Blob', () => {
it('reads and writes blobs', async () => {
it('reads and writes small blobs', async () => {
const { Blob } = firebase.firestore;
await firebase
@ -110,5 +110,23 @@ describe.only('firestore', () => {
blob._binaryString.should.equal(testString);
blob.toBase64().should.equal(testBase64);
});
it('reads and writes large blobs', async () => {
const { Blob } = firebase.firestore;
await firebase
.firestore()
.doc('blob-tests/large')
.set({ blobby: Blob.fromBase64String(testBase64Large) });
const snapshot = await firebase
.firestore()
.doc('blob-tests/large')
.get();
const blob = snapshot.data().blobby;
blob._binaryString.should.equal(testStringLarge);
blob.toBase64().should.equal(testBase64Large);
});
});
});