()
| 501 | } |
| 502 | |
| 503 | function validateNestedListFields() { |
| 504 | cy.get('a[href^="#/collections/settings"]').click(); |
| 505 | cy.get('a[href^="#/collections/settings/entries/hotel_locations"]').click(); |
| 506 | |
| 507 | // add first city list item |
| 508 | cy.contains('button', 'hotel locations').click(); |
| 509 | cy.contains('button', 'cities').click(); |
| 510 | cy.contains('label', 'City').parents().next().first().type('Washington DC'); |
| 511 | cy.contains('label', 'Number of Hotels in City').parents().next().first().type('5'); |
| 512 | cy.contains('button', 'city locations').click(); |
| 513 | |
| 514 | // add second city list item |
| 515 | cy.contains('button', 'cities').click(); |
| 516 | cy.contains('label', 'Cities') |
| 517 | .parents() |
| 518 | .next() |
| 519 | .first() |
| 520 | .find('div[class*=SortableListItem]') |
| 521 | .eq(2) |
| 522 | .as('secondCitiesListControl'); |
| 523 | cy.get('@secondCitiesListControl') |
| 524 | .contains('label', 'City') |
| 525 | .parents() |
| 526 | .next() |
| 527 | .first() |
| 528 | .type('Boston'); |
| 529 | cy.get('@secondCitiesListControl').contains('button', 'city locations').click(); |
| 530 | |
| 531 | cy.contains('button', 'Save').click(); |
| 532 | assertNotification(notifications.error.missingField); |
| 533 | |
| 534 | // list control aliases |
| 535 | cy.contains('label', 'Hotel Locations') |
| 536 | .parents() |
| 537 | .next() |
| 538 | .find('div[class*=SortableListItem]') |
| 539 | .first() |
| 540 | .as('hotelLocationsListControl'); |
| 541 | cy.contains('label', 'Cities') |
| 542 | .parents() |
| 543 | .next() |
| 544 | .find('div[class*=SortableListItem]') |
| 545 | .eq(0) |
| 546 | .as('firstCitiesListControl'); |
| 547 | cy.get('@firstCitiesListControl') |
| 548 | .contains('label', 'City Locations') |
| 549 | .parents() |
| 550 | .next() |
| 551 | .find('div[class*=SortableListItem]') |
| 552 | .first() |
| 553 | .as('firstCityLocationsListControl'); |
| 554 | cy.get('@secondCitiesListControl') |
| 555 | .contains('label', 'City Locations') |
| 556 | .parents() |
| 557 | .next() |
| 558 | .find('div[class*=SortableListItem]') |
| 559 | .first() |
| 560 | .as('secondCityLocationsListControl'); |
no test coverage detected