Skip to content

Commit 05dfcc5

Browse files
Fix tests
1 parent f55015f commit 05dfcc5

File tree

4 files changed

+9
-17
lines changed

4 files changed

+9
-17
lines changed

packages/database/src/core/Repo.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -284,13 +284,6 @@ export function repoStart(repo: Repo): void {
284284
});
285285
}
286286

287-
/**
288-
* @return The namespace represented by the repo.
289-
*/
290-
export function repoName(repo: Repo): string {
291-
return repo.repoInfo_.namespace;
292-
}
293-
294287
/**
295288
* @return The time in milliseconds, taking the server offset into account if we have one.
296289
*/

packages/database/src/core/view/filter/LimitedFilter.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import { QueryParams } from '../QueryParams';
3131
import { Path } from '../../util/Path';
3232
import { CompleteChildSource } from '../CompleteChildSource';
3333
import { ChildChangeAccumulator } from '../ChildChangeAccumulator';
34-
import { repoName } from '../../Repo';
3534

3635
/**
3736
* Applies a limit and a range to a node and uses RangedFilter to do the heavy lifting where possible
@@ -135,7 +134,7 @@ export class LimitedFilter implements NodeFilter {
135134
this.index_.compare(next, this.rangedFilter_.getEndPost()) <= 0;
136135
}
137136
if (inRange) {
138-
filtered = filtered.updateImmediateChild(repoName(next), next.node);
137+
filtered = filtered.updateImmediateChild(next.name, next.node);
139138
count++;
140139
} else {
141140
// if we have reached the end post, we cannot keep adding elemments
@@ -180,7 +179,7 @@ export class LimitedFilter implements NodeFilter {
180179
count++;
181180
} else {
182181
filtered = filtered.updateImmediateChild(
183-
repoName(next),
182+
next.name,
184183
ChildrenNode.EMPTY_NODE
185184
);
186185
}

packages/database/test/info.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ describe('.info Tests', function () {
161161
});
162162

163163
runs(() => {
164-
repoGetDatabase(ref).goOffline();
165-
repoGetDatabase(refAlt).goOffline();
164+
ref.database.goOffline();
165+
refAlt.database.goOffline();
166166
});
167167

168168
// Ensure we're disconnected from both Firebases
@@ -182,7 +182,7 @@ describe('.info Tests', function () {
182182
// Ensure that we don't automatically reconnect upon Reference creation
183183
runs(() => {
184184
ready = 0;
185-
const refDup = repoGetDatabase(ref).ref();
185+
const refDup = ref.database.ref();
186186
refDup.child('.info/connected').on('value', snap => {
187187
ready = snap.val() === true || ready;
188188
});
@@ -197,8 +197,8 @@ describe('.info Tests', function () {
197197
});
198198

199199
runs(() => {
200-
repoGetDatabase(ref).goOnline();
201-
repoGetDatabase(refAlt).goOnline();
200+
ref.database.goOnline();
201+
refAlt.database.goOnline();
202202
});
203203

204204
// Ensure we're connected to both Firebases

packages/database/test/query.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4527,12 +4527,12 @@ describe('Query Tests', () => {
45274527

45284528
expect(readSnapshot.val()).to.deep.equal({ a: 1, b: 2, c: 3 });
45294529

4530-
repoGetDatabase(queryRef).goOffline();
4530+
queryRef.database.goOffline();
45314531

45324532
// Delete an item in the query and then bring our connection back up.
45334533
ea.reset();
45344534
await writerRef.child('b').remove();
4535-
repoGetDatabase(queryRef).goOnline();
4535+
queryRef.database.goOnline();
45364536

45374537
await ea.promise;
45384538
expect(readSnapshot.child('b').val()).to.be.null;

0 commit comments

Comments
 (0)