Skip to content

Commit

Permalink
Fix Cypress admin form test to support <codeflask> rendered HTML.
Browse files Browse the repository at this point in the history
  • Loading branch information
knadh committed Oct 26, 2024
1 parent 25cdb7b commit 87db0d5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions frontend/cypress/e2e/forms.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ describe('Forms', () => {
.its('length')
.should('eq', 1);

cy.get('[data-cy=form] pre').should('not.exist');
cy.get('[data-cy=form] code-flask').should('not.exist');
});

it('Selects public list', () => {
// Click the list checkbox.
cy.get('ul[data-cy=lists] .checkbox').click();

// Make sure the <pre> form HTML has appeared.
cy.get('[data-cy=form] pre').then(($pre) => {
cy.get('code-flask').shadow().find('pre').then(($pre) => {
// Check that the ID of the list in the checkbox appears in the HTML.
cy.get('ul[data-cy=lists] input').then(($inp) => {
cy.wrap($pre).contains($inp.val());
Expand Down Expand Up @@ -111,6 +111,7 @@ describe('Forms', () => {
cy.request('GET', `${apiUrl}/api/campaigns`).then((response) => {
const campUUID = response.body.data.results[0].uuid;
cy.loginAndVisit(`${apiUrl}/subscription/${campUUID}/${subUUID}?manage=1`);
cy.get('a').contains('Manage').click();
});
});

Expand Down

0 comments on commit 87db0d5

Please sign in to comment.