Solution and cypress testing documentation
The solution for the issue is present as well as the cypress testing documentationpull/15355/head
parent
5afb613fce
commit
a40f77c0ac
13
ui/README.md
13
ui/README.md
|
@ -37,6 +37,19 @@ yarn upgrade packageName
|
|||
|
||||
Tests can be run via command line with `yarn test`, from within the `/ui` directory. For more detailed reporting, use `yarn test -- --reporters=verbose`.
|
||||
|
||||
|
||||
## Cypress Testing
|
||||
|
||||
e2e tests:
|
||||
For the end to end tests to run properly, the server needs to be running in the e2e testing mode with the in memory data store.
|
||||
From the influxdb directory
|
||||
`$ ./bin/darwin/influxd --assets-path=ui/build --e2e-testing --store=memory`
|
||||
|
||||
From the ui directory. Build the javascript with
|
||||
`$ yarn start`
|
||||
To run Cypress locally
|
||||
`$ yarn cy:dev`
|
||||
|
||||
## Starting Dev Server
|
||||
|
||||
The assets are built by running `yarn start` from withing the `/ui` directory. The dev server with hot reloading runs at `localhost:8080`.
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
// Libraries
|
||||
import {Dispatch} from 'react'
|
||||
import {push} from 'react-router-redux'
|
||||
|
||||
|
||||
// Constants
|
||||
import * as copy from 'src/shared/copy/notifications'
|
||||
|
@ -68,8 +70,7 @@ export const removeLabelFromCheck = (checkID: string, label: Label) => ({
|
|||
})
|
||||
|
||||
export const getChecks = () => async (
|
||||
dispatch: Dispatch<
|
||||
Action | NotificationAction | ReturnType<typeof checkChecksLimits>
|
||||
dispatch: Dispatch<Action | NotificationAction | ReturnType<typeof checkChecksLimits>
|
||||
>,
|
||||
getState: GetState
|
||||
) => {
|
||||
|
@ -97,14 +98,18 @@ export const getChecks = () => async (
|
|||
}
|
||||
|
||||
export const getCheckForTimeMachine = (checkID: string) => async (
|
||||
dispatch: Dispatch<TimeMachineAction | NotificationAction>
|
||||
dispatch: Dispatch<TimeMachineAction | NotificationAction>, getState: GetState
|
||||
) => {
|
||||
try {
|
||||
dispatch(setCheckStatus(RemoteDataState.Loading))
|
||||
const {
|
||||
orgs: {org}
|
||||
} = getState()
|
||||
|
||||
const resp = await api.getCheck({checkID})
|
||||
|
||||
if (resp.status !== 200) {
|
||||
dispatch(push(`/orgs/${org.id}/alerting`))
|
||||
throw new Error(resp.data.message)
|
||||
}
|
||||
|
||||
|
|
|
@ -163,6 +163,7 @@ class Root extends PureComponent {
|
|||
<Route path="/">
|
||||
<IndexRoute component={RouteToOrg} />
|
||||
<Route path="orgs" component={App}>
|
||||
|
||||
<Route path="new" component={CreateOrgOverlay} />
|
||||
<Route path=":orgID" component={SetOrg}>
|
||||
<IndexRoute component={MePage} />
|
||||
|
|
Loading…
Reference in New Issue