Skip to content

Commit b95a898

Browse files
committed
Update shelter tests
1 parent e83ccbc commit b95a898

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

cypress/e2e/stop-registry/stopDetails.cy.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -967,8 +967,8 @@ describe('Stop details', () => {
967967
stopDetailsPage.shelters
968968
.getTitle()
969969
.shouldHaveText('Pysäkkikatos (1)');
970-
form.getAddNewShelterButton().click();
971-
form.getAddNewShelterButton().click();
970+
stopDetailsPage.shelters.getAddNewShelterButton().click();
971+
stopDetailsPage.shelters.getAddNewShelterButton().click();
972972
form.getShelters().should('have.length', 3);
973973
stopDetailsPage.shelters
974974
.getTitle()

cypress/pageObjects/stop-registry/stop-details/ShelterSection.ts

+4
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ export class SheltersSection {
1818
return cy.getByTestId('SheltersSection::addNewItemButton');
1919
}
2020

21+
getAddNewShelterButton() {
22+
return cy.getByTestId('SheltersSection::addShelter');
23+
}
24+
2125
getSaveButton() {
2226
return cy.getByTestId('SheltersSection::saveButton');
2327
}

cypress/pageObjects/stop-registry/stop-details/SheltersForm.ts

-4
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ export class SheltersForm {
1111
return this.getShelters().eq(index);
1212
}
1313

14-
getAddNewShelterButton() {
15-
return cy.getByTestId('SheltersForm::addShelter');
16-
}
17-
1814
getCopyNewShelterButton() {
1915
return cy.getByTestId('SheltersFormFields::copyShelter');
2016
}

ui/src/components/stop-registry/stops/stop-details/shelters/SheltersForm.spec.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
StopRegistryShelterType,
99
} from '../../../../../generated/graphql';
1010
import { mapShelterDataToFormState } from './schema';
11-
import { useSheltersFormUtils } from './SheltersForm';
11+
import { useSheltersFormUtils } from './useSheltersForm';
1212

1313
jest.mock('react-hook-form', () => {
1414
const actual = jest.requireActual('react-hook-form');

0 commit comments

Comments
 (0)