add element upload UI
This commit is contained in:
parent
4292494345
commit
a2c3ffad8b
3 changed files with 384 additions and 67 deletions
|
|
@ -12,26 +12,17 @@ function loginAsAdmin(): void {
|
|||
function fillElementForm(
|
||||
title: string,
|
||||
description: string,
|
||||
iconImageUrl: string,
|
||||
richText: string,
|
||||
pdfPath: string,
|
||||
youtubeUrl: string,
|
||||
): void {
|
||||
cy.get('[data-cy="admin-element-title"]').clear().type(title)
|
||||
cy.get('[data-cy="admin-element-description"]').clear().type(description)
|
||||
cy.get('[data-cy="admin-element-icon-image-url"]')
|
||||
.clear()
|
||||
.type(iconImageUrl)
|
||||
cy.get('[data-cy="admin-element-rich-text"]').clear()
|
||||
if (richText !== '') {
|
||||
cy.get('[data-cy="admin-element-rich-text"]').type(richText, {
|
||||
parseSpecialCharSequences: false,
|
||||
})
|
||||
}
|
||||
cy.get('[data-cy="admin-element-pdf-path"]').clear()
|
||||
if (pdfPath !== '') {
|
||||
cy.get('[data-cy="admin-element-pdf-path"]').type(pdfPath)
|
||||
}
|
||||
cy.get('[data-cy="admin-element-youtube-url"]').clear()
|
||||
if (youtubeUrl !== '') {
|
||||
cy.get('[data-cy="admin-element-youtube-url"]').type(youtubeUrl)
|
||||
|
|
@ -79,7 +70,6 @@ describe('admin element editing', () => {
|
|||
it('saves element edits and restores the seed content through the UI', () => {
|
||||
const originalTitle = 'Baderech HaAvodah'
|
||||
const originalDescription = 'a structured path for inner and outer growth'
|
||||
const originalIconImageUrl = '/assets/baderech-haavodah-icon.png'
|
||||
const updatedTitle = 'Baderech HaAvodah Updated'
|
||||
const updatedDescription = 'Updated admin description'
|
||||
const updatedRichText = '<p>Updated admin rich text</p>'
|
||||
|
|
@ -90,10 +80,8 @@ describe('admin element editing', () => {
|
|||
fillElementForm(
|
||||
updatedTitle,
|
||||
updatedDescription,
|
||||
originalIconImageUrl,
|
||||
updatedRichText,
|
||||
'',
|
||||
'',
|
||||
)
|
||||
cy.get('[data-cy="admin-element-save"]').click()
|
||||
|
||||
|
|
@ -110,8 +98,6 @@ describe('admin element editing', () => {
|
|||
fillElementForm(
|
||||
originalTitle,
|
||||
originalDescription,
|
||||
originalIconImageUrl,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue