Skip to content

Commit 5a48f05

Browse files
authored
add comments to task bundle widget (#1587)
1 parent bd0057b commit 5a48f05

File tree

3 files changed

+42
-4
lines changed

3 files changed

+42
-4
lines changed

src/components/TaskAnalysisTable/TaskAnalysisTable.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ const DEFAULT_COLUMNS = ["featureId", "id", "status", "priority", "controls", "c
8282
*
8383
* @author [Neil Rotstan](https://github.com/nrotstan)
8484
*/
85-
export class TaskAnalysisTable extends Component {
85+
export class TaskAnalysisTableInternal extends Component {
8686
state = {
8787
openComments: null,
8888
showConfigureColumns: false,
@@ -682,7 +682,7 @@ const setupColumnTypes = (props, taskBaseRoute, manager, data, openComments) =>
682682
return columns
683683
}
684684

685-
TaskAnalysisTable.propTypes = {
685+
TaskAnalysisTableInternal.propTypes = {
686686
/** The tasks to display */
687687
taskInfo: PropTypes.shape({
688688
challengeId: PropTypes.number,
@@ -701,7 +701,7 @@ TaskAnalysisTable.propTypes = {
701701

702702
export default injectIntl(
703703
WithConfigurableColumns(
704-
TaskAnalysisTable,
704+
TaskAnalysisTableInternal,
705705
ALL_COLUMNS,
706706
DEFAULT_COLUMNS,
707707
messages
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import "@testing-library/jest-dom";
2+
import * as React from "react";
3+
import { IntlProvider } from "react-intl";
4+
import { render, fireEvent, screen, waitFor } from "@testing-library/react";
5+
import { TaskAnalysisTableInternal as TaskAnalysisTable } from "./TaskAnalysisTable";
6+
7+
jest.mock(
8+
"../../components/KeywordAutosuggestInput/InTableTagFilter",
9+
() => ({})
10+
);
11+
jest.mock("./TaskAnalysisTableHeader", () => () => <div>Header</div>);
12+
jest.mock("../ViewTask/ViewTask", () => () => <div>ViewTask</div>);
13+
14+
describe("TaskAnalysisTable", () => {
15+
it("doesn't break if given some basic props", () => {
16+
const { getByText, debug } = render(
17+
<IntlProvider locale="en">
18+
<TaskAnalysisTable
19+
selectedTasks={{}}
20+
toggleTaskSelection={() => null}
21+
showColumns={[
22+
"selected",
23+
"featureId",
24+
"id",
25+
"status",
26+
"priority",
27+
"comments",
28+
]}
29+
intl={{ formatMessage: () => null }}
30+
getUserAppSetting={() => null}
31+
selectedTaskCount={() => null}
32+
/>
33+
</IntlProvider>
34+
);
35+
const text = getByText("Header");
36+
expect(text).toBeInTheDocument();
37+
});
38+
});

src/components/Widgets/TaskBundleWidget/TaskBundleWidget.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ const BuildBundle = props => {
347347
taskData={_get(props, 'taskInfo.tasks')}
348348
totalTaskCount={totalTaskCount}
349349
totalTasksInChallenge={ calculateTasksInChallenge(props) }
350-
showColumns={['selected', 'featureId', 'id', 'status', 'priority']}
350+
showColumns={['selected', 'featureId', 'id', 'status', 'priority', 'comments']}
351351
taskSelectionStatuses={[TaskStatus.created, TaskStatus.skipped, TaskStatus.tooHard]}
352352
taskSelectionReviewStatuses={[]}
353353
customHeaderControls={bundleButton}

0 commit comments

Comments
 (0)