Skip to content

Commit

Permalink
add e2e test to action bar
Browse files Browse the repository at this point in the history
  • Loading branch information
VargaJoe committed Oct 30, 2023
1 parent dd363e2 commit decec3f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
22 changes: 22 additions & 0 deletions apps/sensenet/cypress/e2e/content/action_bar.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { PATHS, resolvePathParams } from '../../../src/application-paths'
import { pathWithQueryParams } from '../../../src/services/query-string-builder'

describe('Action bar testing', () => {
beforeEach(() => {
cy.login()
cy.visit(
pathWithQueryParams({
path: resolvePathParams({ path: PATHS.content.appPath, params: { browseType: 'explorer' } }),
newParams: { repoUrl: Cypress.env('repoUrl'), path: '/SampleWorkspace/Document_Library' },
}),
)
})

it('should edit button show in action bar', () => {
cy.get('[data-test="menu-item-document-library"]').rightclick({ force: true })
cy.get('[data-test="content-context-menu-browse"]').click()
cy.get('[data-test="viewtitle-edit"]').should('be.visible').click()
cy.get('[data-test="viewtitle-details"]').should('be.visible').click()
cy.get('[data-test="viewtitle-edit"]').should('be.visible')
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export const ViewTitle: React.FunctionComponent<ViewTitleProps> = (props) => {
<div className={classes.actionBar}>
{props.actionName === 'browse' && (
<span
data-test="viewtitle-edit"
title={`Open ${contentDisplayName} Edit Page`}
onClick={async () => {
history.push(
Expand Down Expand Up @@ -97,6 +98,7 @@ export const ViewTitle: React.FunctionComponent<ViewTitleProps> = (props) => {
)}
{props.actionName === 'edit' && (
<span
data-test="viewtitle-details"
title={`Open ${contentDisplayName} Details Page`}
onClick={async () => {
history.push(
Expand Down

0 comments on commit decec3f

Please sign in to comment.