Skip to content

Commit 08c8a85

Browse files
committed
clean up
1 parent 89cbe78 commit 08c8a85

File tree

8 files changed

+11
-87
lines changed

8 files changed

+11
-87
lines changed

src/components/AccTestComponent/CustomInput/CustomInput.module.scss

Lines changed: 0 additions & 33 deletions
This file was deleted.

src/components/AccTestComponent/CustomInput/CustomInput.tsx

Lines changed: 0 additions & 24 deletions
This file was deleted.

src/components/AccTestComponent/DescribeRenderer/DescribeRenderer.tsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
import React, { useRef, useEffect, ChangeEvent } from 'react';
1+
import React, { ChangeEvent } from 'react';
22
import cn from 'classnames';
33
import { Draggable, Droppable } from 'react-beautiful-dnd';
44
import ItRenderer from '../ItRenderer/ItRenderer';
55
import StandardTagFilter from '../StandardTagFilter/StandardTagFilter';
66
import styles from './DescribeRenderer.module.scss';
77
import { deleteDescribeBlock, addItStatement } from '../../../context/actions/accTestCaseActions';
8-
import { AccTestCaseState } from '../../../utils/accTypes';
98

109
const DescribeRenderer = ({
1110
dispatcher,
@@ -28,12 +27,12 @@ const DescribeRenderer = ({
2827
dispatcher(addItStatement(describeId));
2928
};
3029

31-
const deleteDescribeBlockOnKeyUp = (e) => {
30+
const deleteDescribeBlockOnKeyUp = (e: ChangeEvent) => {
3231
if (e.charCode === 13) {
33-
const describeId = e.target.id;
34-
dispatcher(deleteDescribeBlock(describeId));
32+
const describeId = e.target.id;
33+
dispatcher(deleteDescribeBlock(describeId));
3534
}
36-
}
35+
};
3736

3837
return describeBlocks.allIds.map((id: string , i: number) => (
3938
<Draggable
@@ -53,12 +52,12 @@ const DescribeRenderer = ({
5352
Describe Block
5453
</label>
5554

56-
< StandardTagFilter
55+
<StandardTagFilter
5756
dispatch={dispatcher}
5857
tagAction={updateDescribeStandardTag}
5958
textAction={updateDescribeText}
6059
describeId={id}
61-
catTag={describeBlocks.byId[id].catTag}
60+
standardTag={describeBlocks.byId[id].standardTag}
6261
/>
6362

6463
<i

src/components/AccTestComponent/StandardTagFilter/StandardTagFilter.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import styles from './StandardTagFilter.module.scss';
33

4-
const StandardTagFilter = ({ dispatch, tagAction, textAction, describeId, catTag }) => {
4+
const StandardTagFilter = ({ dispatch, tagAction, textAction, describeId, standardTag }) => {
55
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
66
dispatch(tagAction(describeId, e.target.value));
77
if (e.target.value === 'none') dispatch(textAction(`Component is accessible according to all standards enforced by axe-core.`, describeId));
@@ -11,7 +11,7 @@ const StandardTagFilter = ({ dispatch, tagAction, textAction, describeId, catTag
1111
return (
1212
<div id={styles.StandardTagFilter}>
1313
<label for='accTestStandardTypes'>Choose An Accessibility Standard: </label>
14-
<select value={catTag} id={styles.accTestStandardTypes} onChange={handleChange}>
14+
<select value={standardTag} id={styles.accTestStandardTypes} onChange={handleChange}>
1515
<option value='none'>No Tag</option>
1616
<option value='wcag2a'>WCAG 2.0 Level A</option>
1717
<option value='wcag2aa'>WCAG 2.0 Level AA</option>

src/components/TestCase/AccTestCase.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useContext, ChangeEvent } from 'react';
1+
import React, { useContext } from 'react';
22
import cn from 'classnames';
33
import { DragDropContext, Droppable, DropResult } from 'react-beautiful-dnd';
44

src/components/TestMenu/AccTestMenu.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import {
1313
} from '../../context/actions/globalActions';
1414
import { AccTestCaseContext } from '../../context/reducers/accTestCaseReducer';
1515
import { useToggleModal } from './testMenuHooks';
16-
import AccTestTypes from '../AccTestComponent/AccTestTypes/AccTestTypes';
1716

1817
const AccTestMenu = () => {
1918
// link to accessibility testing docs url

src/context/useGenerateTest.jsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -792,8 +792,6 @@ function useGenerateTest(test, projectFilePath) {
792792
filePath = path.relative(projectFilePath, filePath);
793793
filePath = filePath.replace(/\\/g, '/');
794794

795-
testFileCode += JSON.stringify(accTestCase);
796-
797795
testFileCode += `
798796
const axe = require('axe-core');
799797
const regeneratorRuntime = require('regenerator-runtime');`;

src/utils/accTypes.ts

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
export interface AccTestCaseState {
32
modalOpen: boolean;
43
describeId: number;
@@ -13,22 +12,13 @@ export interface AccTestCaseState {
1312
puppeteerUrl: string;
1413
}
1514
export interface DescribeBlocks {
16-
byId: Object;
15+
byId: Object;
1716
allIds: Array<string>;
1817
}
1918
export interface ItStatements {
2019
byId: Object;
2120
allIds: Object;
2221
}
23-
export interface CustomInput {
24-
id: number;
25-
type: string;
26-
name: string;
27-
placeholder: string;
28-
defaultValue: string;
29-
label: string;
30-
bold: boolean;
31-
}
3222

3323
export interface Action {
3424
type: string;
@@ -45,8 +35,3 @@ export interface Action {
4535
describeBlocks: any[];
4636

4737
}
48-
49-
50-
51-
52-

0 commit comments

Comments
 (0)