Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: Added menu page e2e tests (Issue/3468) #3469

Closed
wants to merge 10 commits into from
Closed

Conversation

lemmyadams
Copy link
Contributor

Copy link
Contributor

Choose a reason for hiding this comment

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

👀

Comment on lines 9 to 26
it(`should have the title '${Course.displayTitle}' and correct description`, () => {
cy.get('.menu__title-inner').should('contain', Course.displayTitle);
cy.get('.menu__body-inner').should('contain', Course.body);
});

it(`should display ${Content.length} menu tiles`, () => {
cy.get('.menu-item').should('have.length', Content.length)

cy.get('.menu-item').each(($item, index) => {
cy.get($item).within(() => {
cy.get('.menu-item__title').should('contain', Content[index].displayTitle)
cy.get('.menu-item__body').should('contain', Content[index].body)
cy.get('button').should('contain', Content[index].linkText)
cy.get('.menu-item__duration').should('contain', Content[index].duration)
cy.get('img.menu-item__image').should('exist').should('have.attr', 'src', Content[index]._graphic.src)
})
})
})
Copy link
Member

Choose a reason for hiding this comment

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

This should really live in adapt-contrib-boxmenu

Copy link
Member

@oliverfoster oliverfoster Oct 6, 2023

Choose a reason for hiding this comment

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

I mean that it should live in the plugin adapt-contrib-boxmenu repo, not in the adapt_framework repo

Comment on lines 28 to 41
it('should have an expandable drawer', () => {
cy.get('.drawer[aria-expanded="true"]').should('not.exist')
cy.get('.drawer[aria-expanded="false"]').should('exist')

cy.get('button[data-event="toggleDrawer"]').click()

cy.get('.drawer[aria-expanded="true"]').should('exist')
cy.get('.drawer[aria-expanded="false"]').should('not.exist')

cy.get('button.drawer__close-btn').click()

cy.get('.drawer[aria-expanded="true"]').should('not.exist')
cy.get('.drawer[aria-expanded="false"]').should('exist')
})
Copy link
Member

@oliverfoster oliverfoster Oct 6, 2023

Choose a reason for hiding this comment

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

This should be in a drawer.cy.js file, or in adapt-contrib-resources, it's very difficult to know if the course has a drawer unless a plugin which requires the drawer is installed.

@joe-allen-89
Copy link
Contributor

New data loading needs to be implemented.

@cahirodoherty-learningpool
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants