From bec4e8c59c8f91e5ad771b9b6ead6d2f7a222ad3 Mon Sep 17 00:00:00 2001 From: Salakar Date: Sat, 5 Aug 2017 21:50:36 +0100 Subject: [PATCH] [tests][database] fixed broken 'root' tests - were incorrectly accessing a private property - switched to using 'path' --- tests/src/tests/database/ref/index.js | 4 ++-- tests/src/tests/database/ref/issueSpecificTests.js | 1 - tests/src/tests/database/ref/rootTests.js | 14 ++------------ 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/tests/src/tests/database/ref/index.js b/tests/src/tests/database/ref/index.js index 7644947f..4d491553 100644 --- a/tests/src/tests/database/ref/index.js +++ b/tests/src/tests/database/ref/index.js @@ -29,14 +29,14 @@ const testGroups = [ ]; function registerTestSuite(testSuite) { - testSuite.beforeEach(async function () { + testSuite.beforeEach(async function beforeEach() { this._databaseRef = testSuite.firebase.native.database().ref('tests/types'); await this._databaseRef.set(DatabaseContents.DEFAULT); await this._databaseRef.parent.child('issues').set(DatabaseContents.ISSUES); }); - testSuite.afterEach(async function () { + testSuite.afterEach(async function afterEach() { await this._databaseRef.set(DatabaseContents.DEFAULT); await this._databaseRef.parent.child('issues').set(DatabaseContents.ISSUES); }); diff --git a/tests/src/tests/database/ref/issueSpecificTests.js b/tests/src/tests/database/ref/issueSpecificTests.js index 7513a1f5..6f94c653 100644 --- a/tests/src/tests/database/ref/issueSpecificTests.js +++ b/tests/src/tests/database/ref/issueSpecificTests.js @@ -24,7 +24,6 @@ function issueTests({ fdescribe, it, context, firebase }) { // Setup const ref = firebase.native.database().ref('tests/issues/108'); - // Test return ref diff --git a/tests/src/tests/database/ref/rootTests.js b/tests/src/tests/database/ref/rootTests.js index 86f1977c..4ab68642 100644 --- a/tests/src/tests/database/ref/rootTests.js +++ b/tests/src/tests/database/ref/rootTests.js @@ -3,31 +3,21 @@ function rootTests({ fdescribe, it, context, firebase }) { context('when called on a non-root reference', () => { it('returns root ref', () => { // Setup - const rootRef = firebase.native.database().ref(); const nonRootRef = firebase.native.database().ref('tests/types/number'); - // Test - - // Assertion - - nonRootRef.root.query.should.eql(rootRef.query); + nonRootRef.root.path.should.eql(rootRef.path); }); }); context('when called on the root reference', () => { it('returns root ref', () => { // Setup - const rootRef = firebase.native.database().ref(); - // Test - - // Assertion - - rootRef.root.query.should.eql(rootRef.query); + rootRef.root.path.should.eql(rootRef.path); }); }); });