mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-15 09:11:57 +10:00
Builder tests: added test for loading screen
This commit is contained in:
@ -20,6 +20,8 @@ const user2 = {
|
||||
isAnonymous: AuthConstants.anonymousUser2.isAnonymous,
|
||||
};
|
||||
|
||||
const defaultDelayInMilliseconds = 100;
|
||||
|
||||
class Database {
|
||||
static get valueEventType() {
|
||||
return valueEventType;
|
||||
@ -60,6 +62,10 @@ class Database {
|
||||
static get user2() {
|
||||
return user2;
|
||||
}
|
||||
|
||||
static get defaultDelayInMilliseconds() {
|
||||
return defaultDelayInMilliseconds;
|
||||
}
|
||||
}
|
||||
|
||||
export default Database;
|
||||
|
||||
@ -149,7 +149,7 @@ class Reference {
|
||||
|
||||
const debouncedEventCallback = debounce(
|
||||
this.eventCallbacks[eventType],
|
||||
100,
|
||||
DatabaseConstants.defaultDelayInMilliseconds,
|
||||
);
|
||||
debouncedEventCallback(snapshot);
|
||||
}
|
||||
@ -183,6 +183,10 @@ class Reference {
|
||||
throw new Error('eventType should be a string.');
|
||||
}
|
||||
|
||||
await new Promise((resolve) =>
|
||||
setTimeout(resolve, DatabaseConstants.defaultDelayInMilliseconds),
|
||||
);
|
||||
|
||||
return Promise.resolve(this._dataSnapshot);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user