mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Follow @roschaefer PR review suggestions
- create mapping for expectedValues in post.js - check from image/jpeg and compress, if not just pass to backend as is
This commit is contained in:
parent
fa02a4dd33
commit
d8d1db389a
@ -5,7 +5,7 @@ import orderBy from 'lodash/orderBy'
|
||||
const languages = orderBy(locales, 'name')
|
||||
const narratorAvatar =
|
||||
"https://s3.amazonaws.com/uifaces/faces/twitter/nerrsoft/128.jpg";
|
||||
|
||||
let expectedValue = { title: 'new post', content: 'new post content', src: 'onourjourney' }
|
||||
When("I type in a comment with {int} characters", size => {
|
||||
var c="";
|
||||
for (var i = 0; i < size; i++) {
|
||||
@ -119,13 +119,15 @@ Then("I add all required fields", () => {
|
||||
})
|
||||
|
||||
Then("the post was saved successfully with the {string} teaser image", condition => {
|
||||
if (condition === 'change')
|
||||
expectedValue = { title: 'to be updated', content: 'successfully updated', src: 'humanconnection' }
|
||||
cy.get(".ds-card-content > .ds-heading")
|
||||
.should("contain", condition === 'new' ? 'new post' : 'to be updated')
|
||||
.should("contain", expectedValue.title)
|
||||
.get(".content")
|
||||
.should("contain", condition === 'new' ? 'new post content' : 'successfully updated')
|
||||
.should("contain", expectedValue.content)
|
||||
.get('.post-page img')
|
||||
.should("have.attr", "src")
|
||||
.and("contains", condition === 'new' ? "onourjourney" : "humanconnection")
|
||||
.and("contains", expectedValue.src)
|
||||
})
|
||||
|
||||
Then("the first image should be removed from the preview", () => {
|
||||
|
||||
@ -114,13 +114,13 @@ export default {
|
||||
},
|
||||
cropImage() {
|
||||
this.showCropper = false
|
||||
if (this.file.type === 'image/png' || this.file.type === 'image/svg+xml') {
|
||||
this.uploadSvgOrPng()
|
||||
} else {
|
||||
if (this.file.type === 'image/jpeg') {
|
||||
this.uploadJpeg()
|
||||
} else {
|
||||
this.uploadOtherImageType()
|
||||
}
|
||||
},
|
||||
uploadSvgOrPng() {
|
||||
uploadOtherImageType() {
|
||||
this.imageAspectRatio = this.file.width / this.file.height || 1.0
|
||||
this.image = new Image()
|
||||
this.image.src = this.file.dataURL
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user