From b9014eb6cbd9b3fcdcd06714aabd5c51af1e7f11 Mon Sep 17 00:00:00 2001 From: gianantoniopini <63844628+gianantoniopini@users.noreply.github.com> Date: Tue, 22 Dec 2020 15:40:36 +0100 Subject: [PATCH] Firebase mock: fixed issue with database namespace --- __mocks__/gatsby-plugin-firebase.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/__mocks__/gatsby-plugin-firebase.js b/__mocks__/gatsby-plugin-firebase.js index de5e07b6..bc84e9fc 100644 --- a/__mocks__/gatsby-plugin-firebase.js +++ b/__mocks__/gatsby-plugin-firebase.js @@ -124,7 +124,7 @@ const database = () => { } } - return Promise.resolve(); + return Promise.resolve(true); }; const update = async (value) => { @@ -138,7 +138,7 @@ const database = () => { __databaseRefUpdateCalls.push(value); - return Promise.resolve(); + return Promise.resolve(true); }; return { @@ -149,20 +149,20 @@ const database = () => { }; }; - const ServerValue = { - TIMESTAMP: Date.now(), - }; - return { __demoResumeId, __emptyResumeId, __init, ref, - ServerValue, }; }; -export default { - auth, - database, +database.ServerValue = { + TIMESTAMP: Date.now(), }; + +export default class firebase { + static auth = auth; + + static database = database; +}