Dashboard page: refactored setup of fetch mock, added more assertions to unit test

This commit is contained in:
gianantoniopini
2021-01-26 14:22:27 +01:00
parent e27bedcf88
commit 8018d7f527
6 changed files with 34 additions and 12 deletions

View File

@ -2,7 +2,7 @@
import { v4 as uuidv4 } from 'uuid';
import Constants from '../constants/auth';
import delay from '../../utils/index';
import { delay } from '../../../src/utils/index';
const singleton = Symbol('');
const singletonEnforcer = Symbol('');

View File

@ -3,7 +3,7 @@ import { v4 as uuidv4 } from 'uuid';
import DatabaseConstants from '../constants/database';
import DataSnapshot from './dataSnapshot';
import delay from '../../utils/index';
import { delay } from '../../../src/utils/index';
const parsePath = (path) => {
if (!path) {

View File

@ -1,6 +1,6 @@
import React from 'react';
import delay from './utils/index';
import { delay } from '../src/utils/index';
const Gatsby = jest.requireActual('gatsby');

View File

@ -1,5 +0,0 @@
const delay = async (milliseconds) => {
await new Promise((resolve) => setTimeout(resolve, milliseconds));
};
export default delay;