Eslint clean up

pull/15355/head
Zoe Steinkamp 2019-10-08 15:50:55 -06:00
parent 5e4ff33ec0
commit e6c2a9f373
4 changed files with 18 additions and 17 deletions

View File

@ -41,18 +41,19 @@ describe('Checks', () => {
})
describe('When a check does not exist', () => {
for(let i = 0; i < 100; i++){
it('should route the user to the alerting index page', () => {
const nonexistentID = '046cd86a2030f000'
it('should route the user to the alerting index page', () => {
const nonexistentID = '046cd86a2030f000'
// visitng the check edit overlay
cy.get('@org').then(({id}: Organization) => {
cy.fixture('routes').then(({orgs, alerting, checks}) => {
cy.visit(`${orgs}/${id}${alerting}${checks}/${nonexistentID}/edit`)
cy.url().should('eq', `${Cypress.config().baseUrl}${orgs}/${id}${alerting}`)
})
// visitng the check edit overlay
cy.get('@org').then(({id}: Organization) => {
cy.fixture('routes').then(({orgs, alerting, checks}) => {
cy.visit(`${orgs}/${id}${alerting}${checks}/${nonexistentID}/edit`)
cy.url().should(
'eq',
`${Cypress.config().baseUrl}${orgs}/${id}${alerting}`
)
})
})
}
})
})
})

View File

@ -2,7 +2,6 @@
import {Dispatch} from 'react'
import {push} from 'react-router-redux'
// Constants
import * as copy from 'src/shared/copy/notifications'
@ -70,7 +69,8 @@ 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
) => {
@ -98,12 +98,13 @@ export const getChecks = () => async (
}
export const getCheckForTimeMachine = (checkID: string) => async (
dispatch: Dispatch<TimeMachineAction | NotificationAction>, getState: GetState
dispatch: Dispatch<TimeMachineAction | NotificationAction>,
getState: GetState
) => {
try {
dispatch(setCheckStatus(RemoteDataState.Loading))
const {
orgs: {org}
orgs: {org},
} = getState()
const resp = await api.getCheck({checkID})

View File

@ -19,7 +19,7 @@ interface DispatchProps {
}
interface StateProps {
endpoint: NotificationEndpoint,
endpoint: NotificationEndpoint
}
type Props = WithRouterProps & DispatchProps & StateProps
@ -68,7 +68,7 @@ const mdtp = {
const mstp = ({endpoints}: AppState, {params, router}: Props): StateProps => {
const endpoint = endpoints.list.find(ep => ep.id === params.endpointID)
if(!endpoint){
if (!endpoint) {
router.push(`/orgs/${params.orgID}/alerting`)
}

View File

@ -163,7 +163,6 @@ 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} />