From b78cc1ac9cfee392d73480bd9df847895c907a97 Mon Sep 17 00:00:00 2001 From: Nechama Krigsman Date: Tue, 23 Jul 2024 14:19:02 -0400 Subject: [PATCH] 5512: add cypress test around creating and serving paper petition without secondary contact phone; --- .../create-and-serve-paper-petition.ts | 72 +++++++++++++++++++ .../petitions-clerk-creates-paper-case.cy.ts | 14 +++- 2 files changed, 85 insertions(+), 1 deletion(-) diff --git a/cypress/helpers/fileAPetition/create-and-serve-paper-petition.ts b/cypress/helpers/fileAPetition/create-and-serve-paper-petition.ts index ba0df62dd5d..7989554c6b3 100644 --- a/cypress/helpers/fileAPetition/create-and-serve-paper-petition.ts +++ b/cypress/helpers/fileAPetition/create-and-serve-paper-petition.ts @@ -142,3 +142,75 @@ export function createAndServePaperPetition( }); }); } + +export function createAndServePaperPetitionMyselfAndSpouse() { + cy.login('petitionsclerk1'); + cy.get('[data-testid="inbox-tab-content"]').should('exist'); + cy.get('[data-testid="document-qc-nav-item"]').click(); + cy.get('[data-testid="start-a-petition"]').click(); + + cy.get('#party-type').select('Petitioner & spouse'); + cy.get('[data-testid="contact-primary-name"]').type('John'); + cy.get('[data-testid="contactPrimary.address1"]').type('111 South West St.'); + cy.get('[data-testid="contactPrimary.city"]').type('Orlando'); + cy.get('[data-testid="contactPrimary.state"]').select('AK'); + cy.get('[data-testid="contactPrimary.postalCode"]').type('09876'); + cy.get('[data-testid="phone"]').type('3232323232'); + cy.get('[data-testid="contact-secondary-name"]').type('John Spouse'); + cy.get('[data-testid="contactSecondary.address1"]').type('address1'); + cy.get('[data-testid="contactSecondary.city"]').type('jackson'); + cy.get('[data-testid="contactSecondary.state"]').select('AL'); + cy.get('[data-testid="contactSecondary.postalCode"]').type('09876'); + cy.get('[data-testid="tab-case-info"] > .button-text').click(); + + cy.get('#date-received-picker').type('07/16/2024'); + cy.get('#mailing-date').type('07/16/2024'); + cy.get('[data-testid="preferred-trial-city"]').select('Birmingham, Alabama'); + cy.get('[data-testid="payment-status-paid-radio"]').click(); + + cy.get('[data-testid="payment-date-picker"]').eq(1).type('07/16/2024'); + cy.get('#petition-payment-method').type('paid'); + cy.get('[data-testid="tab-irs-notice"] > .button-text').click(); + cy.get('[data-testid="case-type-select"]').select('Deficiency'); + + // **** + cy.get('#upload-mode-upload').click(); + cy.get('#petitionFile-file').attachFile('../../helpers/file/sample.pdf'); + + cy.get('#tabButton-requestForPlaceOfTrialFile > .button-text').click(); + // cy.get('#scan-mode-radios').click(); + cy.get('#upload-mode-upload').click(); + cy.get('#requestForPlaceOfTrialFile-file').attachFile( + '../../helpers/file/sample.pdf', + ); + + cy.get('[data-testid="tabButton-stinFile"]').click(); + cy.get('[data-testid="upload-pdf-button"]').click(); + cy.get('input#stinFile-file').attachFile('../../helpers/file/sample.pdf'); + + cy.get('[data-testid="submit-paper-petition"]').click(); + + return cy + .get('.docket-number-header a') + .invoke('attr', 'href') + .then(href => { + const docketNumber = href!.split('/').pop(); + cy.get('[data-testid="serve-case-to-irs"]').click(); + cy.get('[data-testid="modal-confirm"]').click(); + cy.get( + '[data-testid="done-viewing-paper-petition-receipt-button"]', + ).click(); + + cy.get('[data-testid="success-alert"]').contains( + 'Petition served to IRS.', + ); + + cy.get('[data-testid="docket-number-search-input"]').type( + `${docketNumber}`, + ); + + cy.get('[data-testid="search-docket-number"]').click(); + + return cy.wrap(docketNumber); + }); +} diff --git a/cypress/local-only/tests/integration/fileAPetition/petitions-clerk-creates-paper-case.cy.ts b/cypress/local-only/tests/integration/fileAPetition/petitions-clerk-creates-paper-case.cy.ts index 8cdc41eb6a8..833b680d3c3 100644 --- a/cypress/local-only/tests/integration/fileAPetition/petitions-clerk-creates-paper-case.cy.ts +++ b/cypress/local-only/tests/integration/fileAPetition/petitions-clerk-creates-paper-case.cy.ts @@ -11,7 +11,10 @@ import { import { goToCase } from '../../../../helpers/caseDetail/go-to-case'; -import { createAndServePaperPetition } from '../../../../helpers/fileAPetition/create-and-serve-paper-petition'; +import { + createAndServePaperPetition, + createAndServePaperPetitionMyselfAndSpouse, +} from '../../../../helpers/fileAPetition/create-and-serve-paper-petition'; import { unchecksOrdersAndNoticesBoxesInCase } from '../../../support/pages/unchecks-orders-and-notices-boxes-in-case'; describe('Petition clerk creates a paper filing', function () { @@ -132,5 +135,14 @@ describe('Petition clerk creates a paper filing', function () { }); }); }); + + it('should submit case when secondary contact phone number is not provided', () => { + createAndServePaperPetitionMyselfAndSpouse().then(docketNumber => { + cy.get('[data-testid="case-link"]').should( + 'have.text', + `Docket Number: ${docketNumber}`, + ); + }); + }); }); });