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

10339: Test - Private practitioner petition flow #5250

Merged
merged 39 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
3a02556
10339: add cypress tests around step 1 for private practitioner;
nechama-krigsman Aug 12, 2024
79bf571
10339: add tests around step 3 for private practitioner;
nechama-krigsman Aug 12, 2024
f9b983a
10339: add tests around step 5 for private practitioner;
nechama-krigsman Aug 12, 2024
827bce8
10339: add tests around step 6 for private practitioner;
nechama-krigsman Aug 12, 2024
e034fe6
OTP: save redaction acknowledgement for petition and irsNotice files
TomElliottFlexion Aug 13, 2024
5948425
Merge branch 'staging' of https://github.com/ustaxcourt/ef-cms into 1…
TomElliottFlexion Aug 13, 2024
1aef94a
Merge branch 'OPG-redactionAcknowledgment-latest' of https://github.c…
TomElliottFlexion Aug 13, 2024
2cad8af
10339: fix bad merge; add back petitionRedactionAcknowledgement on El…
TomElliottFlexion Aug 13, 2024
4506629
10339: add tests around welcome screen and start a case page;
nechama-krigsman Aug 14, 2024
66fe1ed
Merge branch '10339-story' of https://github.com/flexion/ef-cms into …
nechama-krigsman Aug 14, 2024
ed3369a
10339: add tests around displaying email information for practitioners;
nechama-krigsman Aug 14, 2024
823edc3
Merge branch 'test' of https://github.com/ustaxcourt/ef-cms into 1033…
nechama-krigsman Aug 14, 2024
bde9001
10339: remove getCurrentUser mock;
nechama-krigsman Aug 14, 2024
e5f1f19
10339: remove sentence from welcome page per UX;
nechama-krigsman Aug 14, 2024
4327b7d
10339: remove padding from counsel phone number;
nechama-krigsman Aug 14, 2024
6466523
10339: add phone label to generated petition and review page;
nechama-krigsman Aug 14, 2024
6c6f772
10339: display case description on petition review page;
nechama-krigsman Aug 14, 2024
1b9159e
10339: add tests around display case description on petition review p…
nechama-krigsman Aug 14, 2024
545e93e
10339: update stin text alert;
nechama-krigsman Aug 14, 2024
a4f969a
Merge branch '10339-story' into 10339-test
nechama-krigsman Aug 14, 2024
57c4c13
Merge branch 'staging' into 10339-story
nechama-krigsman Aug 14, 2024
f194a16
10339: add types to sequences;
nechama-krigsman Aug 15, 2024
c7ee8bd
Merge branch '10339-story' into 10339-test
nechama-krigsman Aug 15, 2024
13b9594
Merge branch '5512-story-updates' into 10339-story
nechama-krigsman Aug 15, 2024
1b7465d
Merge branch '10339-story' into 10339-test
nechama-krigsman Aug 15, 2024
bb6e65d
10339: remove unused type;
nechama-krigsman Aug 15, 2024
12f16c5
10339: update test data;
nechama-krigsman Aug 15, 2024
c4e4113
Merge branch '5512-story-updates' into 10339-story
nechama-krigsman Aug 15, 2024
d940b99
Merge branch '10339-story' into 10339-test
nechama-krigsman Aug 15, 2024
8251203
10339: Update assertions to avoid using mock user object as createUse…
nechama-krigsman Aug 15, 2024
dc6387a
Merge branch '10339-story' into 10339-test
nechama-krigsman Aug 15, 2024
dc1415d
Merge branch 'staging' of https://github.com/ustaxcourt/ef-cms into 1…
nechama-krigsman Aug 16, 2024
a2c45e3
Merge branch 'test' of https://github.com/ustaxcourt/ef-cms into 1033…
nechama-krigsman Aug 16, 2024
2320d9e
10339: fix type error;
nechama-krigsman Aug 16, 2024
ce9f4b1
10339: update type for mock user; revert test changes;
nechama-krigsman Aug 16, 2024
8493e0d
Merge branch '10339-story' into 10339-test
nechama-krigsman Aug 16, 2024
9993aa2
10339: fix type error;
nechama-krigsman Aug 16, 2024
b1f10ef
10339: add data to mock user;
nechama-krigsman Aug 16, 2024
248e529
Merge branch '10339-story' into 10339-test
nechama-krigsman Aug 16, 2024
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,137 @@
import {
loginAsPetitioner,
loginAsPrivatePractitioner,
} from '../../../../helpers/authentication/login-as-helpers';

describe('File a petition: Intro', () => {
describe('Petitioner', () => {
describe('Welcome Page', () => {
beforeEach(() => {
loginAsPetitioner('petitioner7');
});
it('should display correct welcome message for petitioner', () => {
cy.get('[data-testid="error-alert-title"]').should(
'have.text',
'Have you already filed a petition by mail or do you want electronic access to your existing case?',
);
cy.get('[data-testid="error-alert-message"]').contains(
'Do not start a new case.',
);
});

it('should display taxpayer tools and free taxpayer help sections', () => {
cy.get('[data-testid="taxpayer-tools-section"]').should('exist');
cy.get('[data-testid="free-taxpayer-help-section"]').should('exist');
});

it('should navigate to the before starting a case page', () => {
cy.get('[data-testid="file-a-petition"]').click();
cy.get('h2').should('have.text', 'How to Create a Case');
});
});

describe('Before starting a case', () => {
beforeEach(() => {
loginAsPetitioner('petitioner');
cy.get('[data-testid="file-a-petition"]').click();
});
it('should display correct text for start a case instructions', () => {
cy.get('[data-testid="upload-irs-notice-title"]').contains(
'If you received',
);
cy.get('[data-testid="upload-irs-notice-bullet-1"]').contains(
'Submit a PDF of the Notice(s) you received',
);
cy.get('[data-testid="confirm-identity-bullet-1"]').contains(
'This document is sent to the IRS to help them identify you',
);
cy.get('[data-testid="confirm-identity-bullet-1"]').contains(
'This is the only document that should contain your SSN, TIN, or EIN.',
);
cy.get('[data-testid="deadline-to-file"]').contains(
'If you received a notice in the mail from the IRS',
);
cy.get('[data-testid="accordion-item-title"]').contains(
'Are you filing jointly with a spouse?',
);

cy.get('[data-testid="accordion-item-title"]').eq(0).click();
cy.get('[data-testid="filing-jointly-accordion-item"]').contains(
"To file a joint Petition with your spouse, you must have the spouse's consent",
);
cy.get('[data-testid="filing-jointly-accordion-item"]').contains(
"If you do not have your spouse's consent",
);
cy.get('[data-testid="filing-jointly-accordion-item"]').contains(
'select “Myself” as the person who is filing.',
);
});
});
});
describe('Practitioner', () => {
describe('Welcome Page', () => {
beforeEach(() => {
cy.login('privatePractitioner3');
});
it('should display correct welcome message text for practitioner', () => {
cy.get('[data-testid="warning-alert-title"]').should(
'have.text',
'Do you need access to an existing case?',
);
cy.get('[data-testid="warning-alert-message"]').should(
'have.text',
'Search for the case docket number to file the appropriate document.',
);
});

it('should not display taxpayer tools and free taxpayer help sections', () => {
cy.get('[data-testid="taxpayer-tools-section"]').should('not.exist');
cy.get('[data-testid="free-taxpayer-help-section"]').should(
'not.exist',
);
});

it('should navigate to the before starting a case page', () => {
cy.get('[data-testid="file-a-petition"]').click();
cy.get('h2').should('have.text', 'How to Create a Case');
});
});

describe('Before starting a case', () => {
beforeEach(() => {
loginAsPrivatePractitioner();
cy.get('[data-testid="file-a-petition"]').click();
});
it('should display correct text for start a case instructions', () => {
cy.get('[data-testid="upload-irs-notice-title"]').contains(
'If the petitioner received',
);
cy.get('[data-testid="upload-irs-notice-bullet-1"]').contains(
'Submit a PDF of the Notice(s) they received',
);
cy.get('[data-testid="confirm-identity-bullet-1"]').contains(
'This document is sent to the IRS to help them identify the petitioner',
);
cy.get('[data-testid="confirm-identity-bullet-1"]').contains(
'This is the only document that should contain the petitioner’s SSN, TIN, or EIN.',
);
cy.get('[data-testid="deadline-to-file"]').contains(
'If the petitioner received a notice in the mail from the IRS',
);
cy.get('[data-testid="accordion-item-title"]').contains(
'Is the petitioner filing jointly with a spouse?',
);
cy.get('[data-testid="accordion-item-title"]').eq(0).click();
cy.get('[data-testid="filing-jointly-accordion-item"]').contains(
'To file a joint Petition with a spouse, the petitioner must have the spouse’s consent.',
);
cy.get('[data-testid="filing-jointly-accordion-item"]').contains(
'If the petitioner does not have the spouse’s consent',
);
cy.get('[data-testid="filing-jointly-accordion-item"]').contains(
'select “Petitioner” as the person you are filing on behalf of.',
);
});
});
});
});
Original file line number Diff line number Diff line change
@@ -1,44 +1,58 @@
import { InputFillType, selectInput, textInput } from './petition-helper';
import { loginAsPetitioner } from '../../../../helpers/authentication/login-as-helpers';
import {
loginAsPetitioner,
loginAsPrivatePractitioner,
} from '../../../../helpers/authentication/login-as-helpers';

describe('File a petition: Step 1 - Petitioner Information', () => {
beforeEach(() => {
loginAsPetitioner();
cy.visit('/file-a-petition/new');
cy.get('[data-testid="step-indicator-current-step-1-icon"]');
});

it('should display all the possible options', () => {
const EXPECTED_FILING_TYPES: string[] = [
'Myself',
'Myself and my spouse',
'A business',
'Other',
];
cy.get('.filing-type-radio-option').should('have.length', 4);
cy.get('.filing-type-radio-option').each((element, index) => {
cy.wrap(element).should('have.text', EXPECTED_FILING_TYPES[index]);
describe('Petitioner', () => {
beforeEach(() => {
loginAsPetitioner();
cy.visit('/file-a-petition/new');
cy.get('[data-testid="step-indicator-current-step-1-icon"]');
});
});

it('should display a validaiton error message if user does not select filing type', () => {
cy.get('[data-testid="filling-type-error-message"]').should('not.exist');
it('should display all the possible options', () => {
const EXPECTED_FILING_TYPES: string[] = [
'Myself',
'Myself and my spouse',
'A business',
'Other',
];
cy.get('.filing-type-radio-option').should('have.length', 4);
cy.get('.filing-type-radio-option').each((element, index) => {
cy.wrap(element).should('have.text', EXPECTED_FILING_TYPES[index]);
});
});

cy.get('[data-testid="step-1-next-button"]').click();
it('should display a validation error message if user does not select filing type', () => {
cy.get('[data-testid="filling-type-error-message"]').should('not.exist');

cy.get('[data-testid="filling-type-error-message"]').should('exist');
});
cy.get('[data-testid="step-1-next-button"]').click();

describe('Myself and my spouse', () => {
beforeEach(() => {
cy.get('[data-testid="filing-type-1"').click();
cy.get('[data-testid="filling-type-error-message"]').should('exist');
});

describe('Country - United States', () => {
describe('Myself and my spouse', () => {
beforeEach(() => {
cy.get('[data-testid="filing-type-1"').click();
cy.get('[data-testid="domestic-country-btn"').click();
});

it('should display correct spouse header', () => {
cy.get('[data-testid="spouse-header"]').should(
'have.text',
"Your spouse's information",
);
});

it('should display correct is spouse deceased text', () => {
cy.get('[data-testid="deceased-spouse-legend"]').should(
'have.text',
'Is your spouse deceased?',
);
});

it('should display all error validation messages when user leaves form empty', () => {
const ERROR_MESSAGES_DATA_TEST_ID = [
'primary-contact-name-error-message',
Expand Down Expand Up @@ -166,6 +180,19 @@ describe('File a petition: Step 1 - Petitioner Information', () => {
cy.get('[data-testid="step-indicator-current-step-2-icon"]');
});

it('should display email fields for spouse', () => {
cy.get('[data-testid="contact-secondary-email"]').should(
'be.visible',
);
cy.get(
'[data-testid="register-email-address-provided-above-for-electronic-filing-and-service-label"]',
).should('be.visible');
cy.get(
'[data-testid="register-email-address-provided-above-for-electronic-filing-and-service-label"]',
).click();
cy.get('[data-testid="warning-alert"]').should('be.visible');
});

it('should allow user to go to step 3 if everything is filled out correctly', () => {
const ERROR_MESSAGES_DATA_TEST_ID: InputFillType[] = [
{
Expand Down Expand Up @@ -268,6 +295,34 @@ describe('File a petition: Step 1 - Petitioner Information', () => {
});
});

it('should display correct text for spouse consent message', () => {
cy.get('[data-testid="warning-alert"]').should(
'have.text',
'To file on behalf of your spouse, you must have consent. If you do not have your spouse\'s consent, select "Myself" as the person who is filing.',
);
});

it('should display correct text for have spouse consent label', () => {
cy.get('[data-testid="have-spouse-consent-label"]').should(
'have.text',
"I have my spouse's consent",
);
});

it('should display email fields for spouse', () => {
cy.get('[data-testid="have-spouse-consent-label"]').click();
cy.get('[data-testid="contact-secondary-email"]').should(
'be.visible',
);
cy.get(
'[data-testid="register-email-address-provided-above-for-electronic-filing-and-service-label"]',
).should('be.visible');
cy.get(
'[data-testid="register-email-address-provided-above-for-electronic-filing-and-service-label"]',
).click();
cy.get('[data-testid="warning-alert"]').should('be.visible');
});

describe('I have Spouse Consent - do not register email', () => {
beforeEach(() => {
cy.get('[data-testid="have-spouse-consent-label"').click();
Expand Down Expand Up @@ -434,4 +489,66 @@ describe('File a petition: Step 1 - Petitioner Information', () => {
});
});
});
describe('Practitioner', () => {
beforeEach(() => {
loginAsPrivatePractitioner();
cy.visit('/file-a-petition/new');
cy.get('[data-testid="step-indicator-current-step-1-icon"]');
cy.get('[data-testid="filing-type-1"').click();
});

describe('Petitioner and spouse', () => {
it('should display correct spouse header', () => {
cy.get('[data-testid="spouse-header"]').should(
'have.text',
"Spouse's information",
);
});

it('should display correct is spouse deceased text', () => {
cy.get('[data-testid="deceased-spouse-legend"]').should(
'have.text',
'Is the spouse deceased?',
);
});
describe('Spouse is not deceased', () => {
beforeEach(() => {
cy.get('[data-testid="is-spouse-deceased-1"]').click();
});
it('should display correct text for spouse consent message', () => {
cy.get('[data-testid="warning-alert"]').should(
'have.text',
'To file on behalf of a spouse, you must have consent. If you do not have the spouse’s consent, select “Petitioner” as the person you are filing on behalf of.',
);
});
it('should display correct text for have spouse consent label', () => {
cy.get('[data-testid="have-spouse-consent-label"]').should(
'have.text',
"I have the spouse's consent",
);
});

it('should not display email fields for spouse', () => {
cy.get('[data-testid="have-spouse-consent-label"]').click();
cy.get('[data-testid="contact-secondary-email"]').should('not.exist');
cy.get(
'[data-testid="register-email-address-provided-above-for-electronic-filing-and-service-label"]',
).should('not.exist');
});
});

describe('Spouse is deceased', () => {
beforeEach(() => {
cy.get('[data-testid="is-spouse-deceased-0"]').click();
});

it('should not display email fields for spouse', () => {
cy.get('[data-testid="contact-secondary-email"]').should('not.exist');
cy.get(
'[data-testid="register-email-address-provided-above-for-electronic-filing-and-service-label"]',
).should('not.exist');
});
});
});
});
});
Loading
Loading