mirror of
https://github.com/ansible/awx.git
synced 2026-02-18 19:50:05 -03:30
fix eslint issues with app and conditional redirect tests
This commit is contained in:
@@ -34,4 +34,4 @@ describe('<App />', () => {
|
||||
const login = appWrapper.find(Login);
|
||||
expect(login.length).toBe(0);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { Component } from 'react';
|
||||
import React from 'react';
|
||||
import {
|
||||
Route,
|
||||
Redirect
|
||||
@@ -9,7 +9,11 @@ import ConditionalRedirect from '../../src/components/ConditionalRedirect';
|
||||
describe('<ConditionalRedirect />', () => {
|
||||
test('renders Redirect when shouldRedirect is passed truthy func', () => {
|
||||
const truthyFunc = () => true;
|
||||
const shouldHaveRedirectChild = shallow(<ConditionalRedirect shouldRedirect={() => truthyFunc()} />);
|
||||
const shouldHaveRedirectChild = shallow(
|
||||
<ConditionalRedirect
|
||||
shouldRedirect={() => truthyFunc()}
|
||||
/>
|
||||
);
|
||||
const redirectChild = shouldHaveRedirectChild.find(Redirect);
|
||||
expect(redirectChild.length).toBe(1);
|
||||
const routeChild = shouldHaveRedirectChild.find(Route);
|
||||
@@ -18,10 +22,14 @@ describe('<ConditionalRedirect />', () => {
|
||||
|
||||
test('renders Route when shouldRedirect is passed falsy func', () => {
|
||||
const falsyFunc = () => false;
|
||||
const shouldHaveRouteChild = shallow(<ConditionalRedirect shouldRedirect={() => falsyFunc()} />);
|
||||
const shouldHaveRouteChild = shallow(
|
||||
<ConditionalRedirect
|
||||
shouldRedirect={() => falsyFunc()}
|
||||
/>
|
||||
);
|
||||
const routeChild = shouldHaveRouteChild.find(Route);
|
||||
expect(routeChild.length).toBe(1);
|
||||
const redirectChild = shouldHaveRouteChild.find(Redirect);
|
||||
expect(redirectChild.length).toBe(0);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user