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

10460 + 10461: Handle Feedback and Cleanup for Public Trial Session #5591

Merged
merged 16 commits into from
Dec 4, 2024
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
@@ -0,0 +1,12 @@
import { checkA11y } from '../../../../support/generalCommands/checkA11y';

describe('Trial Sessions - Public Accessibility', () => {
beforeEach(() => {
Cypress.session.clearCurrentSessionData();
});

it('should be free of a11y issues', () => {
cy.visit('/trial-sessions');
checkA11y();
});
});
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {
CASE_STATUS_TYPES,
SESSION_STATUS_TYPES,
SESSION_TYPES,
} from '../../../../../shared/src/business/entities/EntityConstants';
import { createAndServePaperPetition } from '../../../../helpers/fileAPetition/create-and-serve-paper-petition';
Expand Down Expand Up @@ -79,7 +80,7 @@ describe('trial sessions filtering', () => {
setTrialSessionFilters({
judge,
proceedingType,
sessionStatus: 'Open',
sessionStatus: SESSION_STATUS_TYPES.open,
sessionType,
startDate,
tabName: 'calendared',
Expand Down Expand Up @@ -107,7 +108,7 @@ describe('trial sessions filtering', () => {
setTrialSessionFilters({
judge,
proceedingType,
sessionStatus: 'Closed',
sessionStatus: SESSION_STATUS_TYPES.closed,
sessionType,
startDate,
tabName: 'calendared',
Expand Down
5 changes: 5 additions & 0 deletions shared/src/business/entities/EntityConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ export const STANDING_PRETRIAL_EVENT_CODES = ['SPOS', 'SPTO'];

export const CLERK_OF_THE_COURT_CONFIGURATION = 'clerk-of-court-configuration';

export const FETCHED_TRIAL_SESSIONS_TIMESTAMP_KEY =
'FetchedTrialSessionsTimestamp';

export const PUBLIC_TRIAL_SESSIONS_DATA_KEY = 'publicTrialSessionsData';

export const LEGACY_DOCUMENT_TYPES = [
{
documentType: 'Designation of Counsel to Receive Service',
Expand Down
5 changes: 3 additions & 2 deletions shared/src/business/entities/cases/Case.isHearing.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Case } from './Case';
import { MOCK_CASE } from '../../../test/mockCase';
import { SESSION_TYPES } from '@shared/business/entities/EntityConstants';
import { TrialSession } from '../trialSessions/TrialSession';
import { mockDocketClerkUser } from '@shared/test/mockAuthUsers';

Expand All @@ -9,7 +10,7 @@ describe('isHearing', () => {
isCalendared: true,
judge: { name: 'Judge Buch' },
maxCases: 100,
sessionType: 'Regular',
sessionType: SESSION_TYPES.regular,
startDate: '2025-03-01T00:00:00.000Z',
term: 'Fall',
termYear: '2025',
Expand All @@ -35,7 +36,7 @@ describe('isHearing', () => {
isCalendared: true,
judge: { name: 'Judge Buch' },
maxCases: 100,
sessionType: 'Regular',
sessionType: SESSION_TYPES.regular,
startDate: '2025-03-01T00:00:00.000Z',
term: 'Fall',
termYear: '2025',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Case } from './Case';
import { MOCK_CASE } from '../../../test/mockCase';
import { SESSION_TYPES } from '@shared/business/entities/EntityConstants';
import { TrialSession } from '../trialSessions/TrialSession';
import { mockDocketClerkUser } from '@shared/test/mockAuthUsers';

Expand All @@ -9,7 +10,7 @@ describe('removeFromHearing', () => {
isCalendared: true,
judge: { name: 'Judge Buch' },
maxCases: 100,
sessionType: 'Regular',
sessionType: SESSION_TYPES.regular,
startDate: '2025-03-01T00:00:00.000Z',
term: 'Fall',
termYear: '2025',
Expand Down
12 changes: 8 additions & 4 deletions shared/src/business/entities/cases/Case.removeFromTrial.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { CASE_STATUS_TYPES, CHIEF_JUDGE } from '../EntityConstants';
import {
CASE_STATUS_TYPES,
CHIEF_JUDGE,
SESSION_TYPES,
} from '../EntityConstants';
import { Case } from './Case';
import { MOCK_CASE } from '../../../test/mockCase';
import { TrialSession } from '../trialSessions/TrialSession';
Expand All @@ -18,7 +22,7 @@ describe('removeFromTrial', () => {
isCalendared: true,
judge: { name: 'Judge Buch', userId: 'judge-user-id' },
maxCases: 100,
sessionType: 'Regular',
sessionType: SESSION_TYPES.regular,
startDate: '2025-03-01T00:00:00.000Z',
term: 'Fall',
termYear: '2025',
Expand Down Expand Up @@ -68,7 +72,7 @@ describe('removeFromTrial', () => {
isCalendared: true,
judge: { name: 'Judge Buch', userId: 'judge-user-id' },
maxCases: 100,
sessionType: 'Regular',
sessionType: SESSION_TYPES.regular,
startDate: '2025-03-01T00:00:00.000Z',
term: 'Fall',
termYear: '2025',
Expand Down Expand Up @@ -103,7 +107,7 @@ describe('removeFromTrial', () => {
isCalendared: true,
judge: { name: 'Judge Buch', userId: 'judge-user-id' },
maxCases: 100,
sessionType: 'Regular',
sessionType: SESSION_TYPES.regular,
startDate: '2025-03-01T00:00:00.000Z',
term: 'Fall',
termYear: '2025',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CASE_STATUS_TYPES } from '../EntityConstants';
import { CASE_STATUS_TYPES, SESSION_TYPES } from '../EntityConstants';
import { Case } from './Case';
import { MOCK_CASE } from '../../../test/mockCase';
import { TrialSession } from '../trialSessions/TrialSession';
Expand All @@ -18,7 +18,7 @@ describe('removeFromTrialWithAssociatedJudge', () => {
isCalendared: true,
judge: { name: 'Judge Buch', userId: 'buch_id' },
maxCases: 100,
sessionType: 'Regular',
sessionType: SESSION_TYPES.regular,
startDate: '2025-03-01T00:00:00.000Z',
term: 'Fall',
termYear: '2025',
Expand Down Expand Up @@ -60,7 +60,7 @@ describe('removeFromTrialWithAssociatedJudge', () => {
isCalendared: true,
judge: { name: 'Judge Buch', userId: 'buch-id' },
maxCases: 100,
sessionType: 'Regular',
sessionType: SESSION_TYPES.regular,
startDate: '2025-03-01T00:00:00.000Z',
term: 'Fall',
termYear: '2025',
Expand Down
10 changes: 7 additions & 3 deletions shared/src/business/entities/cases/Case.setAsCalendared.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { CASE_STATUS_TYPES, CHIEF_JUDGE } from '../EntityConstants';
import {
CASE_STATUS_TYPES,
CHIEF_JUDGE,
SESSION_TYPES,
} from '../EntityConstants';
import { Case } from './Case';
import { MOCK_CASE } from '../../../test/mockCase';
import { TrialSession } from '../trialSessions/TrialSession';
Expand Down Expand Up @@ -33,7 +37,7 @@ describe('setAsCalendared', () => {
isCalendared: true,
judge: { name: 'Judge Buch', userId: 'buch-id' },
maxCases: 100,
sessionType: 'Regular',
sessionType: SESSION_TYPES.regular,
startDate: '2025-03-01T00:00:00.000Z',
term: 'Fall',
termYear: '2025',
Expand Down Expand Up @@ -63,7 +67,7 @@ describe('setAsCalendared', () => {
isCalendared: false,
judge: { name: 'Judge Buch', userId: 'buch-id' },
maxCases: 100,
sessionType: 'Regular',
sessionType: SESSION_TYPES.regular,
startDate: '2025-03-01T00:00:00.000Z',
term: 'Fall',
termYear: '2025',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ describe('sortByDocketNumber', () => {
});

describe('sortByDocketNumberAndGroupConsolidatedCases', () => {
it('should return the cases sorted properly, with a consolidated case appearing after its lead cases', () => {
it('should return the cases sorted properly, with a consolidated case appearing after its lead case', () => {
const result = Case.sortByDocketNumberAndGroupConsolidatedCases([
{
docketNumber: '100-19',
Expand Down
3 changes: 2 additions & 1 deletion shared/src/business/entities/cases/Case.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
PARTY_TYPES,
PAYMENT_STATUS,
SERVICE_INDICATOR_TYPES,
SESSION_TYPES,
UNIQUE_OTHER_FILER_TYPE,
} from '../EntityConstants';
import { Case, getContactPrimary } from './Case';
Expand Down Expand Up @@ -239,7 +240,7 @@ describe('Case entity', () => {
const mockhearing1 = {
createdAt: '2024-03-01T00:00:00.000Z',
maxCases: 100,
sessionType: 'Regular',
sessionType: SESSION_TYPES.regular,
startDate: '2025-03-01T00:00:00.000Z',
term: 'Fall',
termYear: '2025',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { CASE_STATUS_TYPES, CHIEF_JUDGE } from '../EntityConstants';
import {
CASE_STATUS_TYPES,
CHIEF_JUDGE,
SESSION_TYPES,
} from '../EntityConstants';
import { Case } from './Case';
import { MOCK_CASE } from '../../../test/mockCase';
import { TrialSession } from '../trialSessions/TrialSession';
Expand Down Expand Up @@ -49,7 +53,7 @@ describe('updateTrialSessionInformation', () => {
isCalendared: true,
judge: { name: 'Judge Buch', userId: 'buch_id' },
maxCases: 100,
sessionType: 'Regular',
sessionType: SESSION_TYPES.regular,
startDate: '2025-03-01T00:00:00.000Z',
term: 'Fall',
termYear: '2025',
Expand Down Expand Up @@ -78,7 +82,7 @@ describe('updateTrialSessionInformation', () => {
isCalendared: false,
judge: { name: 'Judge Buch' },
maxCases: 100,
sessionType: 'Regular',
sessionType: SESSION_TYPES.regular,
startDate: '2025-03-01T00:00:00.000Z',
term: 'Fall',
termYear: '2025',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { MOCK_TRIAL_INPERSON } from '../../../test/mockTrial';
import { SESSION_TYPES } from '@shared/business/entities/EntityConstants';
import { TrialSession } from './TrialSession';

describe('TrialSession entity', () => {
Expand All @@ -7,7 +8,7 @@ describe('TrialSession entity', () => {
const trialSession = new TrialSession({
...MOCK_TRIAL_INPERSON,
caseOrder: [],
sessionType: 'Hybrid',
sessionType: SESSION_TYPES.hybrid,
});

trialSession.addCaseToCalendar({ docketNumber: '123-45' });
Expand All @@ -19,7 +20,7 @@ describe('TrialSession entity', () => {
const trialSession = new TrialSession({
...MOCK_TRIAL_INPERSON,
caseOrder: [],
sessionType: 'Hybrid',
sessionType: SESSION_TYPES.hybrid,
});

trialSession.addCaseToCalendar({ docketNumber: '123-45' });
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { MOCK_TRIAL_REGULAR } from '../../../test/mockTrial';
import { SESSION_TYPES } from '@shared/business/entities/EntityConstants';
import { TrialSession } from './TrialSession';

describe('TrialSession entity', () => {
Expand All @@ -14,7 +15,7 @@ describe('TrialSession entity', () => {
it('should generate correct sort key prefix for a small trial session', () => {
const trialSession = new TrialSession({
...MOCK_TRIAL_REGULAR,
sessionType: 'Small',
sessionType: SESSION_TYPES.small,
});

expect(trialSession.generateSortKeyPrefix()).toEqual(
Expand All @@ -25,7 +26,7 @@ describe('TrialSession entity', () => {
it('should generate correct sort key prefix for a hybrid trial session', () => {
const trialSession = new TrialSession({
...MOCK_TRIAL_REGULAR,
sessionType: 'Hybrid',
sessionType: SESSION_TYPES.hybrid,
});

expect(trialSession.generateSortKeyPrefix()).toEqual(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
COUNTRY_TYPES,
DOCKET_NUMBER_SUFFIXES,
PARTY_TYPES,
SESSION_TYPES,
} from '../entities/EntityConstants';
import { MOCK_CASE } from '../../test/mockCase';
import { applicationContext } from '../test/createTestApplicationContext';
Expand Down Expand Up @@ -205,7 +206,7 @@ describe('getCaseDeadlinesInteractor', () => {
maxCases: '100',
postalCode: '20217',
// missing proceedingType; should throw an error!
sessionType: 'Special',
sessionType: SESSION_TYPES.special,
startDate: '2021-01-27T05:00:00.000Z',
startTime: '13:00',
state: 'DC',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import { RawTrialSession } from '../../entities/trialSessions/TrialSession';
import { TRIAL_SESSION_PROCEEDING_TYPES } from '../../entities/EntityConstants';
import {
SESSION_TYPES,
TRIAL_SESSION_PROCEEDING_TYPES,
} from '../../entities/EntityConstants';
import { canSetTrialSessionAsCalendaredInteractor } from './canSetTrialSessionAsCalendaredInteractor';
import { mockPetitionsClerkUser } from '@shared/test/mockAuthUsers';

const MOCK_TRIAL = {
maxCases: 100,
proceedingType: TRIAL_SESSION_PROCEEDING_TYPES.inPerson,
sessionType: 'Regular',
sessionType: SESSION_TYPES.regular,
startDate: '2025-12-01T00:00:00.000Z',
term: 'Fall',
termYear: '2025',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { FORMATS, formatNow } from '../../utilities/DateHandler';
import { RawNewTrialSession } from '@shared/business/entities/trialSessions/NewTrialSession';
import { TRIAL_SESSION_PROCEEDING_TYPES } from '../../entities/EntityConstants';
import {
SESSION_TYPES,
TRIAL_SESSION_PROCEEDING_TYPES,
} from '../../entities/EntityConstants';
import { applicationContext } from '../../test/createTestApplicationContext';
import { validateTrialSessionInteractor } from './validateTrialSessionInteractor';

Expand All @@ -18,7 +21,7 @@ describe('validateTrialSessionInteractor', () => {
const MOCK_TRIAL = {
maxCases: 100,
proceedingType: TRIAL_SESSION_PROCEEDING_TYPES.inPerson,
sessionType: 'Regular',
sessionType: SESSION_TYPES.regular,
startDate: `${nextYear}-12-01T00:00:00.000Z`,
term: 'Fall',
termYear: nextYear,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { SESSION_STATUS_TYPES } from '@shared/business/entities/EntityConstants';

export const FORMATTED_CASES = [
{
calendarNotes:
Expand Down Expand Up @@ -451,7 +453,7 @@ export const FORMATTED_TRIAL_SESSION = {
formattedStartDateFull: 'January 26, 2023',
formattedTerm: 'Winter 23',
formattedTrialClerk: 'Test trial clerk',
sessionStatus: 'Open',
sessionStatus: SESSION_STATUS_TYPES.open,
startDateForAdditionalPageHeaders: 'Jan 26, 2023',
trialLocation: 'Washington, District of Columbia',
};
Expand Down
Loading
Loading