Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mbeard/APPEALS-32391 #19806

Closed
wants to merge 18 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ const AdminTabs = ({ activeLevers, reorderLevers, updateLeverValue }) => {
};


export default connect(mapStateToProps, mapDispatchToProps)(AdminTabs);
export default connect(mapStateToProps, mapDispatchToProps)(AdminTabs);
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
import React from 'react';
import { render } from '@testing-library/react';
import StaticLeverWrapper from './StaticLeversWrapper';
import StaticLeversWrapper from './StaticLeversWrapper';
import { levers } from 'test/data/adminCaseDistributionLevers';

describe('StaticLeverWrapper', () => {
describe('StaticLeversWrapper', () => {
it('renders inactive levers correctly', () => {
const inactiveLevers = levers.filter((lever) => !lever.is_active);
const { getByText } = render(<StaticLeverWrapper />);
const inactiveLever = getByText(inactiveLevers[0].description);
const { getByText } = render(
<StaticLeversWrapper leverList={inactiveLevers.map((lever) => lever.item)}
leverStore={{ getState: () => (
{ levers }) }} />
);
const inactiveLever1 = getByText(inactiveLevers[0].description);
const inactiveLever2 = getByText(inactiveLevers[1].description);

expect(inactiveLever).toBeInTheDocument();
expect(inactiveLever1).toBeInTheDocument();
expect(inactiveLever2).toBeInTheDocument();
});
});
2 changes: 1 addition & 1 deletion client/app/admin/reducers/Levers/leversReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const leversReducer = (state = initialState, action = {}) => {

export const formatLeverHistory = (lever_history_list) => {
let formatted_lever_history = []
const row_id_list = [...new Set(lever_history_list.map(x => `${x.created_at},${x.user}`))];
const row_id_list = [...new Set(lever_history_list)].map(x => `${x.created_at},${x.user}`);

row_id_list.forEach( function (row_id) {
let row_created_at = row_id.split(',')[0];
Expand Down
Loading
Loading