Skip to content

Commit

Permalink
add comments to task bundle widget (#1587)
Browse files Browse the repository at this point in the history
  • Loading branch information
jschwarz2030 authored Mar 20, 2021
1 parent bd0057b commit 5a48f05
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/components/TaskAnalysisTable/TaskAnalysisTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const DEFAULT_COLUMNS = ["featureId", "id", "status", "priority", "controls", "c
*
* @author [Neil Rotstan](https://github.com/nrotstan)
*/
export class TaskAnalysisTable extends Component {
export class TaskAnalysisTableInternal extends Component {
state = {
openComments: null,
showConfigureColumns: false,
Expand Down Expand Up @@ -682,7 +682,7 @@ const setupColumnTypes = (props, taskBaseRoute, manager, data, openComments) =>
return columns
}

TaskAnalysisTable.propTypes = {
TaskAnalysisTableInternal.propTypes = {
/** The tasks to display */
taskInfo: PropTypes.shape({
challengeId: PropTypes.number,
Expand All @@ -701,7 +701,7 @@ TaskAnalysisTable.propTypes = {

export default injectIntl(
WithConfigurableColumns(
TaskAnalysisTable,
TaskAnalysisTableInternal,
ALL_COLUMNS,
DEFAULT_COLUMNS,
messages
Expand Down
38 changes: 38 additions & 0 deletions src/components/TaskAnalysisTable/TaskAnalysisTable.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import "@testing-library/jest-dom";
import * as React from "react";
import { IntlProvider } from "react-intl";
import { render, fireEvent, screen, waitFor } from "@testing-library/react";
import { TaskAnalysisTableInternal as TaskAnalysisTable } from "./TaskAnalysisTable";

jest.mock(
"../../components/KeywordAutosuggestInput/InTableTagFilter",
() => ({})
);
jest.mock("./TaskAnalysisTableHeader", () => () => <div>Header</div>);
jest.mock("../ViewTask/ViewTask", () => () => <div>ViewTask</div>);

describe("TaskAnalysisTable", () => {
it("doesn't break if given some basic props", () => {
const { getByText, debug } = render(
<IntlProvider locale="en">
<TaskAnalysisTable
selectedTasks={{}}
toggleTaskSelection={() => null}
showColumns={[
"selected",
"featureId",
"id",
"status",
"priority",
"comments",
]}
intl={{ formatMessage: () => null }}
getUserAppSetting={() => null}
selectedTaskCount={() => null}
/>
</IntlProvider>
);
const text = getByText("Header");
expect(text).toBeInTheDocument();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ const BuildBundle = props => {
taskData={_get(props, 'taskInfo.tasks')}
totalTaskCount={totalTaskCount}
totalTasksInChallenge={ calculateTasksInChallenge(props) }
showColumns={['selected', 'featureId', 'id', 'status', 'priority']}
showColumns={['selected', 'featureId', 'id', 'status', 'priority', 'comments']}
taskSelectionStatuses={[TaskStatus.created, TaskStatus.skipped, TaskStatus.tooHard]}
taskSelectionReviewStatuses={[]}
customHeaderControls={bundleButton}
Expand Down

0 comments on commit 5a48f05

Please sign in to comment.