department-of-veterans-affairs / va-mobile-app

"If VA were a company, it would have a flagship mobile app."
https://department-of-veterans-affairs.github.io/va-mobile-app/
15 stars 2 forks source link

BUG - sev-4 - All - Remove hard-coded test data from app #4262

Closed TKDickson closed 1 year ago

TKDickson commented 1 year ago

What happened?

Pre-demo mode, we hard-coded certain features to show test data for specific test users. Such as: image.png

We have demo mode, so we don't need these now. Plus, speaking from personal experience, they can really freak out QA Engineers who stumble across them when testing with those users :)

Desired behavior

Fake data should live in demo mode only.

Bug Severity - BE SURE TO ADD THE SEVERITY LABEL

See [Issue Tracking](https://github.com/department-of-veterans-affairs/va.gov-team/blob/master/products/va-mobile-app/testing/VA%20Mobile%20App%20Test%20Plan.md#issue-tracking) for details on Severity Levels

Linked to Story

Screen shot(s) and additional information

Ticket Checklist

DJUltraTom commented 1 year ago

@Sparowhawk can we get steps for QA Validation listed in the Description of this ticket?

DJUltraTom commented 1 year ago

Given information from slack convo (collapsed in chunk below) I have checked user 226 and user 1414 and verified test data has been removed and we are showing data as it is being sent to us from the service

expand for testing steps and info from slack convo: basically login as these users: user_1414: ‘vets.gov.user+1414@gmail.com’, user_1401: ‘vets.gov.user+1401@gmail.com’, user_1402: ‘vets.gov.user+1402@gmail.com’, user_226: ‘vets.gov.user+226@gmail.com’, user_366: ‘vets.gov.user+366@gmail.com’, 12:32 then if (signInEmail === MockUsersEmail.user_1414) { pastAppointments = { data: [ { type: 'appointment', id: '4', attributes: { appointmentType: AppointmentTypeConstants.VA, status: AppointmentStatusConstants.BOOKED, phoneOnly: false, statusDetail: null, isCovidVaccine: true, isPending: false, startDateLocal: '2021-09-06T19:53:14.000+00:00', startDateUtc: '2021-09-06T19:53:14.000+00:00', minutesDuration: 60, comment: 'Please arrive 20 minutes before the start of your appointment', timeZone: 'America/Los_Angeles' as AppointmentTimeZone, healthcareService: 'Blind Rehabilitation Center', healthcareProvider: null, reason: null, location: { name: 'VA Long Beach Healthcare System', address: { street: '5901 East 7th Street', city: 'Long Beach', state: 'CA', zipCode: '90822', }, phone: { number: '456-7890', extension: '', areaCode: '123', }, url: '', code: '', }, practitioner: { prefix: 'Dr.', firstName: 'Larry', middleName: '', lastName: 'TestDoctor', }, }, }, { id: '2', type: 'appointment', attributes: { appointmentType: AppointmentTypeConstants.VA, healthcareService: 'CHY PC VAR2', healthcareProvider: null, location: { name: 'Cheyenne VA Medical Center', address: { street: '2360 East Pershing Boulevard', city: 'Cheyenne', state: 'WY', zipCode: '82001-5356', }, phone: { areaCode: '307', number: '778-7550', extension: '', }, url: '', code: '', }, minutesDuration: 60, phoneOnly: true, isCovidVaccine: false, isPending: false, startDateLocal: '2021-09-17T13:10:00.000-06:00', startDateUtc: '2021-09-17T19:10:00.000+00:00', status: AppointmentStatusConstants.BOOKED, statusDetail: null, timeZone: 'America/Denver' as AppointmentTimeZone, comment: '', reason: null, }, }, ], } } 12:32 for 1414 make sure that doesn’t show up 12:32 if (signInEmail === MockUsersEmail.user_1414) { upcomingAppointments = { data: [ { type: 'appointment', id: '1', attributes: { appointmentType: AppointmentTypeConstants.VA, status: AppointmentStatusConstants.CANCELLED, phoneOnly: false, statusDetail: null, isCovidVaccine: true, isPending: false, startDateLocal: '2022-09-06T19:53:14.000+00:00', startDateUtc: '2022-09-06T19:53:14.000+00:00', minutesDuration: 60, comment: 'Please arrive 20 minutes before the start of your appointment', timeZone: 'America/Los_Angeles' as AppointmentTimeZone, healthcareService: 'Blind Rehabilitation Center', healthcareProvider: null, reason: null, location: { name: 'VA Long Beach Healthcare System', address: { street: '5901 East 7th Street', city: 'Long Beach', state: 'CA', zipCode: '90822', }, phone: { number: '456-7890', extension: '', areaCode: '123', }, url: '', code: '', }, practitioner: { prefix: 'Dr.', firstName: 'Larry', middleName: '', lastName: 'TestDoctor', }, }, }, { id: '2', type: 'appointment', attributes: { appointmentType: AppointmentTypeConstants.VA, healthcareService: 'CHY PC VAR2', healthcareProvider: null, location: { name: 'Cheyenne VA Medical Center', address: { street: '2360 East Pershing Boulevard', city: 'Cheyenne', state: 'WY', zipCode: '82001-5356', }, phone: { areaCode: '307', number: '778-7550', extension: '', }, url: '', code: '', }, minutesDuration: 60, phoneOnly: false, isCovidVaccine: true, isPending: false, startDateLocal: '2022-09-17T13:10:00.000-06:00', startDateUtc: '2022-09-17T19:10:00.000+00:00', status: AppointmentStatusConstants.BOOKED, statusDetail: null, timeZone: 'America/Denver' as AppointmentTimeZone, comment: '', reason: null, }, }, { id: '3', type: 'appointment', attributes: { appointmentType: AppointmentTypeConstants.VA_VIDEO_CONNECT_HOME, cancelId: '', comment: '', healthcareService: 'CHEYENNE VAMC', healthcareProvider: null, location: { name: 'Cheyenne VA Medical Center', address: { street: '2360 East Pershing Boulevard', city: 'Cheyenne', state: 'WY', zipCode: '82001-5356', }, phone: { areaCode: '307', number: '778-7550', extension: '', }, url: 'https://dev.care.va.gov/vvc-app/?name=NADEAU%2CMARCY&join=1&media=1&escalate=1&conference=VAC000416762@dev.care.va.gov&pin=990510&aid=c821687c-5844-4421-9180-dcc18236a62a#', code: '990510#', }, minutesDuration: 20, phoneOnly: false, startDateLocal: '2022-09-01T11:15:00.000-06:00', startDateUtc: '2022-09-01T17:15:00.000+00:00', status: AppointmentStatusConstants.BOOKED, statusDetail: null, timeZone: 'America/Denver' as AppointmentTimeZone, reason: null, isCovidVaccine: false, isPending: false, }, }, ], meta: { errors: [{ source: AppointmentsErrorServiceTypesConstants.COMMUNITY_CARE }], dataFromStore: false, }, } } 12:32 along with that 12:33 if (signInEmail === MockUsersEmail.user_1414) { throw { status: 503, } } 12:33 that user should get this message when trying to do an appeal 12:34 if (signInEmail === MockUsersEmail.user_1402) { // appeals unavailable with no claims activeClaimsAndAppeals.meta = { dataFromStore: false, errors: [ { service: ClaimsAndAppealsErrorServiceTypesConstants.APPEALS, }, ], pagination: { currentPage: 1, totalEntries: 1, perPage: 10, }, } closedClaimsAndAppeals.meta = activeClaimsAndAppeals.meta activeClaimsAndAppeals.data = [] closedClaimsAndAppeals.data = [] } else if (signInEmail === MockUsersEmail.user_1401) { // claims unavailable with appeals activeClaimsAndAppeals.meta = { dataFromStore: false, errors: [ { service: ClaimsAndAppealsErrorServiceTypesConstants.CLAIMS, }, ], pagination: { currentPage: 1, totalEntries: 1, perPage: 10, }, } activeClaimsAndAppeals.data = activeClaimsAndAppeals.data.filter((item) => { return item.type === 'appeal' }) closedClaimsAndAppeals.data = closedClaimsAndAppeals.data.filter((item) => { return item.type === 'appeal' }) } else if (signInEmail !== MockUsersEmail.user_366) { const { claimsAndAppealsMetaPagination, loadedClaimsAndAppeals: loadedItems } = getState().claimsAndAppeals const activeLoadedClaimsAndAppeals = getLoadedClaimsAndAppeals(loadedItems, claimsAndAppealsMetaPagination, ClaimTypeConstants.ACTIVE, 1, DEFAULT_PAGE_SIZE) const closedLoadedClaimsAndAppeals = getLoadedClaimsAndAppeals(loadedItems, claimsAndAppealsMetaPagination, ClaimTypeConstants.CLOSED, 1, DEFAULT_PAGE_SIZE) if (activeLoadedClaimsAndAppeals) { activeClaimsAndAppeals = activeLoadedClaimsAndAppeals } else { activeClaimsAndAppeals = await api.get('/v0/claims-and-appeals-overview', { 'page[number]': '1', 'page[size]': DEFAULT_PAGE_SIZE.toString(), showCompleted: 'false', }) } if (closedLoadedClaimsAndAppeals) { closedClaimsAndAppeals = closedLoadedClaimsAndAppeals } else { closedClaimsAndAppeals = await api.get('/v0/claims-and-appeals-overview', { 'page[number]': '1', 'page[size]': DEFAULT_PAGE_SIZE.toString(), showCompleted: 'true', }) } } 12:34 1402 should have appeals unavailable with no claims 12:34 if (signInEmail === MockUsersEmail.user_226) { appeal = { data: Appeal, } } 12:34 That one should have the fake appeals 12:34 if (userEmail === MockUsersEmail.user_1401) { throw { status: 408 } } 12:35 That user should have that error 12:35 that should cover everything I think