mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2026-02-06 09:56:03 +00:00
Added integration tests for uploading and displaying a user's profile header image. Adjusted existing tests for the profile image to make them more distinct.
This commit is contained in:
parent
f62efe39fa
commit
ca00968444
@ -38,6 +38,7 @@ The following features will be implemented. This gets done in three steps:
|
||||
|
||||
* Upload and Change Avatar
|
||||
* Upload and Change Profile Picture
|
||||
* Upload and Change Profile Header Image
|
||||
* Edit Social Media Accounts
|
||||
* Edit Locale information
|
||||
* Show and delete Bookmarks \(later\)
|
||||
|
||||
@ -24,13 +24,39 @@ Then("I should be able to change my profile picture", () => {
|
||||
);
|
||||
});
|
||||
|
||||
Then("I should be able to change my profile header picture", () => {
|
||||
const headerUpload = "onourjourney.png";
|
||||
|
||||
cy.fixture(headerUpload, "base64").then(fileContent => {
|
||||
cy.get("#profileHeaderDropzone").upload(
|
||||
{ fileContent, fileName: headerUpload, mimeType: "image/png" },
|
||||
{ subjectType: "drag-n-drop", force: true }
|
||||
);
|
||||
});
|
||||
cy.get(".profile-header-image")
|
||||
.should("have.attr", "src")
|
||||
.and("contains", "onourjourney");
|
||||
cy.contains(".iziToast-message", "Upload successful").should(
|
||||
"have.length",
|
||||
1
|
||||
);
|
||||
});
|
||||
|
||||
When("I visit another user's profile page", () => {
|
||||
cy.openPage("profile/peter-pan");
|
||||
});
|
||||
|
||||
Then("I cannot upload a picture", () => {
|
||||
Then("I cannot upload a profile picture", () => {
|
||||
cy.get(".base-card")
|
||||
.children()
|
||||
.should("not.have.id", "customdropzone")
|
||||
.should("have.class", "user-avatar");
|
||||
});
|
||||
|
||||
|
||||
Then("I cannot upload a profile header image", () => {
|
||||
cy.get(".base-card")
|
||||
.children()
|
||||
.should("not.have.id", "profileHeaderDropzone")
|
||||
.should("have.class", "profile-header");
|
||||
});
|
||||
|
||||
@ -0,0 +1,18 @@
|
||||
Feature: Upload UserProfile Header
|
||||
As a user
|
||||
I would like to be able to add a profile header pic to my profile
|
||||
So that I can personalize my profile
|
||||
|
||||
|
||||
Background:
|
||||
Given I have a user account
|
||||
|
||||
Scenario: Change my UserProfile Header
|
||||
Given I am logged in
|
||||
And I visit my profile page
|
||||
Then I should be able to change my profile header picture
|
||||
|
||||
Scenario: Unable to change another user's header images
|
||||
Given I am logged in with a "user" role
|
||||
And I visit another user's profile page
|
||||
Then I cannot upload a profile header image
|
||||
@ -15,4 +15,4 @@ Feature: Upload UserProfile Image
|
||||
Scenario: Unable to change another user's avatar
|
||||
Given I am logged in with a "user" role
|
||||
And I visit another user's profile page
|
||||
Then I cannot upload a picture
|
||||
Then I cannot upload a profile picture
|
||||
Loading…
x
Reference in New Issue
Block a user