Skip to content
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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A changeset is only required when making changes to the base layer

Empty file.
20 changes: 1 addition & 19 deletions web/corps/app/components/Form/Correction/Step1.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,14 @@ const correctionLabelOverrides = getCorrectionLabelOverrides()
>
<ManageCompanyName
v-model:active-name-request="store.formState.activeNameRequest"
v-model:active-name-translation="store.formState.activeNameTranslation"
:loading="store.initializing"
:business
:contact="businessContact"
:correct-name-options="getCorrectNameOptionsForCorpType(business?.legalType)"
:nr-allowed-actions-types="FILING_NR_ALLOWED_ACTIONS[FilingType.CORRECTION]"
/>

<!-- Section 1: Name Translations -->
<section class="space-y-4" data-testid="name-translations-section">
<div>
<h2 class="text-base">
{{ $t('label.nameTranslations') }}
</h2>
<p>{{ $t('text.nameTranslationsDescription') }}</p>
</div>

<ManageNameTranslations
v-model:active-name-translation="store.formState.activeNameTranslation"
:loading="store.initializing"
:empty-text="store.initializing ? `${$t('label.loading')}...` : $t('label.noNameTranslations')"
:add-label="$t('label.addNameTranslation')"
:allowed-actions="[ManageAllowedAction.ADD, ManageAllowedAction.NAME_CHANGE, ManageAllowedAction.REMOVE]"
:label-overrides="correctionLabelOverrides"
/>
</section>

<!-- Section 2: Office Addresses -->
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seemed to me that ManageCompanyName was already Section 1, so I didn’t update the section numbers afterward.

<section class="space-y-4" data-testid="office-addresses-section">
<div>
Expand Down
33 changes: 0 additions & 33 deletions web/corps/tests/e2e/specs/correction/page-init.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,6 @@ import { CRCTN, CRCTN_NO_FEE } from '~~/tests/mocks'

const identifier = 'BC1234567'
const filingId = '999001'
const nameTranslationsMock = {
aliases: [
{ id: '1001', type: 'TRANSLATION', name: 'Nom Entreprise' },
{ id: '1002', type: 'TRANSLATION', name: 'Raison Sociale' }
]
}

async function mockNameTranslations(page: Page, businessIdentifier: string, aliasesJSON = nameTranslationsMock) {
await page.route(`**/api/v2/businesses/${businessIdentifier}/aliases`, async (route) => {
await route.fulfill({ json: aliasesJSON })
})
}

/** Edit a director's address inline and wait for the form to close (CI-resilient). */
async function makeDirectorEdit(page: Page, fillValue: string) {
Expand Down Expand Up @@ -58,8 +46,6 @@ async function assertCommonElements(page: Page) {
}

async function assertStep1Sections(page: Page) {
// has name translations section
await expect(page.getByTestId('name-translations-section')).toBeVisible()
// has office addresses section
await expect(page.getByTestId('office-addresses-section')).toBeVisible()
// has directors section
Expand Down Expand Up @@ -220,25 +206,6 @@ test.describe('Correction - Page init', () => {
})
})

test.describe('Name translations', () => {
test('should load and display name translations from aliases API', async ({ page }) => {
await setupCorrectionPage(page, identifier, filingId, CRCTN_NO_FEE, 'STAFF', 'STAFF')
await mockNameTranslations(page, identifier)
await navigateToCorrectionPage(page, identifier, filingId)
await page.waitForLoadState('networkidle')

await expect(page.getByText(/loading/i)).not.toBeVisible({ timeout: 15000 })

const section = page.getByTestId('name-translations-section')
const tbody = section.locator('tbody')

await expect(section).toBeVisible()
await expect(tbody).toContainText('Nom Entreprise')
await expect(tbody).toContainText('Raison Sociale')
await expect(tbody.locator('tr')).toHaveCount(2)
})
})

test.describe('Action labels', () => {
test('should display "Correct" instead of "Change" for action buttons', async ({ page }) => {
await setupCorrectionPage(page, identifier, filingId, CRCTN_NO_FEE, 'STAFF', 'STAFF')
Expand Down
54 changes: 0 additions & 54 deletions web/corps/tests/e2e/specs/correction/submit.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,6 @@ import { CRCTN, CRCTN_NO_FEE } from '~~/tests/mocks'
const identifier = 'BC1234567'
const filingId = '999001'

const aliasesNameTranslationsMock = {
aliases: [
{ id: '10001', type: 'TRANSLATION', name: 'Nom Entreprise' }
]
}

async function mockNameTranslations(page: Page, businessIdentifier: string, aliasesJSON = aliasesNameTranslationsMock) {
await page.route(`**/api/v2/businesses/${businessIdentifier}/aliases**`, async (route) => {
await route.fulfill({ json: aliasesJSON })
})
}

async function makeDirectorChange(page: Page) {
const directors = page.getByTestId('current-directors-section').locator('tbody')
const rowToEdit = directors.locator('tr').filter({ hasText: 'TESTER TESTING' })
Expand Down Expand Up @@ -117,48 +105,6 @@ test.describe('Correction - Filing Submit', () => {
)
expect(page.url()).toContain(`${process.env.NUXT_PUBLIC_BUSINESS_DASHBOARD_URL}${identifier}`)
})

test('should display name translations and submit when unchanged', async ({ page }) => {
await mockNameTranslations(page, identifier)

const aliasesRequest = page.waitForResponse(
response =>
response.url().includes(`/api/v2/businesses/${identifier}/aliases`)
&& response.request().method() === 'GET',
{ timeout: 10000 }
)

await setupCorrectionPage(page, identifier, filingId, CRCTN_NO_FEE, 'STAFF', 'STAFF')
await navigateToCorrectionPage(page, identifier, filingId)
await aliasesRequest
await page.waitForLoadState('networkidle')
await expect(page.getByText(/loading/i)).not.toBeVisible({ timeout: 15000 })

const nameTranslationSection = page.getByTestId('name-translations-section')
await expect(nameTranslationSection).toBeVisible()
await expect(nameTranslationSection.locator('tbody')).toContainText('Nom Entreprise')

// Make a different correction so submission can proceed.
await makeDirectorChange(page)

await goToReview(page)
await fillCorrectionComment(page, 'Correcting existing name translation')
await fillCompletingParty(page)
await page.getByRole('radio', { name: 'No Fee' }).click()

const submitRequest = page.waitForRequest(
req => req.url().includes(`/businesses/${identifier}/filings`) && req.method() === 'PUT',
{ timeout: 10000 }
)

await page.getByRole('button', { name: 'Submit' }).click()
const request = await submitRequest
const requestBody = request.postDataJSON()
const correction = requestBody.filing.correction

// Name translations are unchanged, so no translation delta should be sent.
expect(correction.nameTranslations).toEqual([])
})
})

test.describe('Save and resume', () => {
Expand Down
Loading