test element uploads
This commit is contained in:
parent
cd2e63d17d
commit
4292494345
1 changed files with 42 additions and 0 deletions
|
|
@ -120,4 +120,46 @@ describe('admin element editing', () => {
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.and('contain.text', 'Saved')
|
.and('contain.text', 'Saved')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('uploads icon and pdf files immediately through the UI', () => {
|
||||||
|
cy.resetDb()
|
||||||
|
loginAsAdmin()
|
||||||
|
cy.visit('/admin/element/1')
|
||||||
|
|
||||||
|
cy.get('[data-cy="admin-element-icon-image-input"]').selectFile(
|
||||||
|
'public/assets/baderech-haavodah-icon.png',
|
||||||
|
{ force: true },
|
||||||
|
)
|
||||||
|
cy.get('[data-cy="admin-element-icon-image-status"]')
|
||||||
|
.should('be.visible')
|
||||||
|
.and('contain.text', 'Icon image updated')
|
||||||
|
cy.get('[data-cy="admin-element-current-icon"]')
|
||||||
|
.should('be.visible')
|
||||||
|
.and('have.attr', 'src')
|
||||||
|
.and('include', '/storage/element-icons/')
|
||||||
|
|
||||||
|
cy.get('[data-cy="admin-element-pdf-input"]').selectFile(
|
||||||
|
'public/assets/pdfs/baderech.pdf',
|
||||||
|
{ force: true },
|
||||||
|
)
|
||||||
|
cy.get('[data-cy="admin-element-pdf-status"]')
|
||||||
|
.should('be.visible')
|
||||||
|
.and('contain.text', 'PDF updated')
|
||||||
|
cy.get('[data-cy="admin-element-current-pdf"]')
|
||||||
|
.should('be.visible')
|
||||||
|
.and('have.attr', 'href')
|
||||||
|
.and('include', '/storage/element-pdfs/')
|
||||||
|
|
||||||
|
cy.contains('header.site-header a', 'View Element').click()
|
||||||
|
cy.get('[data-cy="element-icon"]')
|
||||||
|
.should('be.visible')
|
||||||
|
.and('have.attr', 'src')
|
||||||
|
.and('include', '/storage/element-icons/')
|
||||||
|
cy.get('[data-cy="element-pdf-link"]')
|
||||||
|
.should('be.visible')
|
||||||
|
.and('have.attr', 'href')
|
||||||
|
.and('include', '/storage/element-pdfs/')
|
||||||
|
|
||||||
|
cy.resetDb()
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue