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

Revert "Ttahub 182/add three new topics" #351

Merged
merged 1 commit into from
Jul 8, 2021
Merged
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
@@ -1,11 +1,10 @@
/* eslint-disable react/jsx-props-no-spreading */
import '@testing-library/jest-dom';
import { render, screen, fireEvent } from '@testing-library/react';
import { render, screen } from '@testing-library/react';
import React from 'react';
import { FormProvider, useForm } from 'react-hook-form/dist/index.ie11';
import { Router } from 'react-router-dom';
import { createMemoryHistory } from 'history';
import userEvent from '@testing-library/user-event';

import topics from '../topicsResources';

Expand All @@ -26,21 +25,6 @@ const RenderTopicsResourcesReview = ({ data }) => {
);
};

const RenderTopicsResources = () => {
const history = createMemoryHistory();
const hookForm = useForm({
mode: 'onChange',
});
// eslint-disable-next-line react/prop-types
return (
<Router history={history}>
<FormProvider {...hookForm}>
{topics.render()}
</FormProvider>
</Router>
);
};

describe('Topics & resources', () => {
const data = {
attachments: [{ originalFileName: 'attachment', url: { url: 'http://localhost/attachment' }, status: 'APPROVED' }],
Expand All @@ -58,52 +42,4 @@ describe('Topics & resources', () => {
expect(await screen.findByText('topics')).toBeVisible();
});
});

describe('edit topics page', () => {
it('displays correct topics', async () => {
render(<RenderTopicsResources reportId={1} />);
const topicsSelectBtn = screen.getByText(/topic\(s\) covered\. you may choose more than one\./i);
userEvent.click(topicsSelectBtn);
const topicSelect = screen.getByText(/select is focused ,type to refine list, press down to open the menu, press left to focus selected values/i);
fireEvent.focus(topicSelect);
fireEvent.keyDown(topicSelect, { key: 'ArrowDown', code: 40 });
expect(await screen.findByText('Behavioral / Mental Health')).toBeVisible();
expect(await screen.findByText('Child Assessment, Development, Screening')).toBeVisible();
expect(await screen.findByText('CLASS: Classroom Management')).toBeVisible();
expect(await screen.findByText('CLASS: Emotional Support')).toBeVisible();
expect(await screen.findByText('CLASS: Instructional Support')).toBeVisible();
expect(await screen.findByText('Coaching')).toBeVisible();
expect(await screen.findByText('Communication')).toBeVisible();
expect(await screen.findByText('Community and Self-Assessment')).toBeVisible();
expect(await screen.findByText('Culture & Language')).toBeVisible();
expect(await screen.findByText('Curriculum (Early Childhood or Parenting)')).toBeVisible();
expect(await screen.findByText('Data and Evaluation')).toBeVisible();
expect(await screen.findByText('ERSEA')).toBeVisible();
expect(await screen.findByText('Environmental Health and Safety')).toBeVisible();
expect(await screen.findByText('Equity')).toBeVisible();
expect(await screen.findByText('Facilities')).toBeVisible();
expect(await screen.findByText('Family Support Services')).toBeVisible();
expect(await screen.findByText('Fiscal / Budget')).toBeVisible();
expect(await screen.findByText('Five-Year Grant')).toBeVisible();
expect(await screen.findByText('Home Visiting')).toBeVisible();
expect(await screen.findByText('Human Resources')).toBeVisible();
expect(await screen.findByText('Leadership / Governance')).toBeVisible();
expect(await screen.findByText('Learning Environments')).toBeVisible();
expect(await screen.findByText('Nutrition')).toBeVisible();
expect(await screen.findByText('Oral Health')).toBeVisible();
expect(await screen.findByText('Parent and Family Engagement')).toBeVisible();
expect(await screen.findByText('Partnerships and Community Engagement')).toBeVisible();
expect(await screen.findByText('Physical Health and Screenings')).toBeVisible();
expect(await screen.findByText('Pregnancy Services / Expectant Families')).toBeVisible();
expect(await screen.findByText('Program Planning and Services')).toBeVisible();
expect(await screen.findByText('QIP')).toBeVisible();
expect(await screen.findByText('Recordkeeping and Reporting')).toBeVisible();
expect(await screen.findByText('Safety Practices')).toBeVisible();
expect(await screen.findByText('Staff Wellness')).toBeVisible();
expect(await screen.findByText('Teaching Practices / Teacher-Child Interactions')).toBeVisible();
expect(await screen.findByText('Technology and Information Systems')).toBeVisible();
expect(await screen.findByText('Transition Practices')).toBeVisible();
expect(await screen.findByText('Transportation')).toBeVisible();
});
});
});
3 changes: 0 additions & 3 deletions frontend/src/pages/ActivityReport/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,10 @@ export const topics = [
'Data and Evaluation',
'ERSEA',
'Environmental Health and Safety',
'Equity',
'Facilities',
'Family Support Services',
'Fiscal / Budget',
'Five-Year Grant',
'Home Visiting',
'Human Resources',
'Leadership / Governance',
'Learning Environments',
Expand All @@ -93,7 +91,6 @@ export const topics = [
'QIP',
'Recordkeeping and Reporting',
'Safety Practices',
'Staff Wellness',
'Teaching Practices / Teacher-Child Interactions',
'Technology and Information Systems',
'Transition Practices',
Expand Down