Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Views
import AppWrapper from '../AppWrapper'
// require('!style-loader!css-loader!normalize.css')
// require('bootstrap/less/bootstrap')
// require('styles/main')
const createdMuiTheme = createMuiTheme(FirstVoicesTheme)
const context = {
providedState: {
properties: {
title: ConfGlobal.title,
pageTitleParams: null,
domain: ConfGlobal.domain,
},
},
}
describe('AppWrapper', () => {
test('Mounts', () => {
// Structure: Arrange
const container = document.createElement('div')
ReactDOM.render(
,
container)
expect(container.querySelector('#pageNavigation').textContent).toMatch('EXPLORE LANGUAGES')
routes.forEach((value) => {
const matchTest = matchPath(value.get('path'), pathArray)
const matchAlias = matchPath(value.get('alias'), pathArray)
if (matchTest.matched || matchAlias.matched) {
const routeParams = matchTest.routeParams
// Extract common paths from URL
if (value.has('extractPaths') && value.get('extractPaths')) {
const domainPathLocation = pathArray.indexOf(ConfGlobal.domain)
const dialectPathLocation = 5
const languagePathLocation = 4
const languageFamilyPathLocation = 3
// If domain is specified in the URL, these are Nuxeo paths that can be extracted
if (domainPathLocation !== -1) {
// Path from domain to end of path (e.g. /FV/Workspaces/Data/family/language/dialect)
const nuxeoPath = pathArray.slice(domainPathLocation, pathArray.length)
if (nuxeoPath.length >= dialectPathLocation) {
routeParams.dialect_name = decodeURI(nuxeoPath[dialectPathLocation])
routeParams.dialect_path = decodeURI('/' + nuxeoPath.slice(0, dialectPathLocation + 1).join('/'))
}
if (nuxeoPath.length >= languagePathLocation) {
routeParams.language_name = decodeURI(nuxeoPath[languagePathLocation])
import { Provider } from 'react-redux'
import store from 'providers/redux/store'
// Views
import AppWrapper from 'views/AppWrapper'
require('!style-loader!css-loader!normalize.css')
require('bootstrap/less/bootstrap')
require('styles/main')
const context = {
providedState: {
properties: {
title: ConfGlobal.title,
pageTitleParams: null,
domain: ConfGlobal.domain,
},
},
}
render(
,
document.getElementById('app-wrapper')
)
/*window.addEventListener("unhandledrejection", function(err, promise) {
// handle error here, for example log
});*/
// TODO: https://gist.github.com/Aldredcz/4d63b0a9049b00f54439f8780be7f0d8
CHANGE_TITLE_PARAMS,
OVERRIDE_BREADCRUMBS,
PAGE_PROPERTIES,
LOAD_GUIDE_STARTED,
LOAD_GUIDE_SUCCESS,
LOAD_GUIDE_ERROR,
LOAD_NAVIGATION_STARTED,
LOAD_NAVIGATION_SUCCESS,
LOAD_NAVIGATION_ERROR,
SET_ROUTE_PARAMS,
} from './actionTypes'
const initialStateProperties = {
title: ConfGlobal.title,
pageTitleParams: null,
domain: ConfGlobal.domain,
siteTheme: 'default',
}
const DEFAULT_ROUTE_PARAMS = {
pageSize: '10', // using strings since these values are pulled from the url bar
page: '1', // using strings since these values are pulled from the url bar
siteTheme: 'explore',
area: SECTIONS,
}
const DEFAULT_SEARCH = {
pageSize: '10', // using strings since these values are pulled from the url bar
page: '1', // using strings since these values are pulled from the url bar
sortBy: 'dc:title',
sortOrder: 'asc',
}
export const navigationReducer = combineReducers({
computeNavigateTo(state = { path: null }, action = {}) {