function createRtdbProfileRefStub() {
  let profileUpdate = {}
  return {
    update: sinon.spy((setData) => {
      // Fail automatically for intentionally rejected promise
      // (used in testing that rejecting set promise is handled)
      if (setData === 'fail') {
        return Promise.reject(new Error('test'))
      }
      profileUpdate = setData
      return Promise.resolve()
    }),
    once: createSuccessStub({
      val: () => ({ ...existingProfile, ...profileUpdate })
    })
  }
}
Create an object representing a "profileReference" (a Firebase
RTDB Reference at the Profile path) which contains Sinon stubs
in place of Firebase JS SDK methods (such as update and once)

@returns {object}