How to use the conf/local.json.testData function in conf

To help you get started, we’ve selected a few conf examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github First-Peoples-Cultural-Council / fv-web-ui / frontend / app / assets / javascripts / providers / FVWord.js View on Github external
errorDismissed: action.type === DISMISS_ERROR ? true : false,
        })
        break

      default:
        return Object.assign({}, state, { isFetching: false })
        break
    }
  },
}

const mockRequest = {
  createWord: {
    // args PathOrId + type of document
    args: [
      ConfGlobal.testData.sectionOrWorkspaces + ConfGlobal.testData.dialectPath + '/Dictionary',
      {
        type: 'FVWord',
        name: ConfGlobal.testData.word.name + Date.now().toString(),
        properties: ConfGlobal.testData.word.properties,
      },
    ],
    evaluateResults: function(response) {
      return response.type == 'FVDialect' && response.properties != null
    },
  },
}

const middleware = [thunk]

export default { actions, reducers, middleware, mockRequest }
github First-Peoples-Cultural-Council / fv-web-ui / frontend / app / assets / javascripts / providers / FVLanguageFamily.js View on Github external
const fetchLanguageFamily = RESTActions.fetch('FV_LANGUAGE_FAMILY', 'FVLanguageFamily', {
  headers: { 'enrichers.document': 'ancestry' },
})

const actions = { fetchLanguageFamily }

const computeLanguageFamilyFetch = RESTReducers.computeFetch('language_family')

const reducers = {
  computeLanguageFamily: computeLanguageFamilyFetch.computeLanguageFamily,
}

const mockRequest = {
  fetchLanguageFamily: {
    // args PathOrId + type of document
    args: [ConfGlobal.testData.sectionOrWorkspaces + ConfGlobal.testData.languageFamilyPath, 'FVLanguageFamily'],
    evaluateResults: function(response) {
      return response.type == 'FVLanguageFamily' && response.properties != null
    },
  },
}

const middleware = [thunk]

export default { actions, reducers, middleware, mockRequest }