Skip to content

Commit

Permalink
Revert "Revert "Ttahub 182/add three new topics"" (#352)
Browse files Browse the repository at this point in the history
* Revert "Revert "Ttahub 182/add three new topics""

* Update yaml config to push to SB.
  • Loading branch information
AdamAdHocTeam authored Jul 8, 2021
1 parent e0fa9c0 commit 8b29053
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ parameters:
default: "main"
type: string
sandbox_git_branch: # change to feature branch to test deployment
default: "TTAHUB-138/al-issue-found-with-tp"
default: "revert-351-revert-349-TTAHUB-182/Add-Three-New-Topics"
type: string
prod_new_relic_app_id:
default: "877570491"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/* eslint-disable react/jsx-props-no-spreading */
import '@testing-library/jest-dom';
import { render, screen } from '@testing-library/react';
import { render, screen, fireEvent } 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 @@ -25,6 +26,21 @@ 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 @@ -42,4 +58,52 @@ 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: 3 additions & 0 deletions frontend/src/pages/ActivityReport/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,12 @@ 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 @@ -91,6 +93,7 @@ export const topics = [
'QIP',
'Recordkeeping and Reporting',
'Safety Practices',
'Staff Wellness',
'Teaching Practices / Teacher-Child Interactions',
'Technology and Information Systems',
'Transition Practices',
Expand Down

0 comments on commit 8b29053

Please sign in to comment.