...
 
Commits (2)
......@@ -3,14 +3,14 @@
context('Blogs', () => {
before(() => {
cy.getCookie('minds_sess')
.then((sessionCookie) => {
if (sessionCookie === null) {
return cy.login(true);
}
});
.then((sessionCookie) => {
if (sessionCookie === null) {
return cy.login(true);
}
});
});
beforeEach(()=> {
beforeEach(() => {
cy.preserveCookies();
cy.server();
cy.route('POST', '**/api/v1/blog/new').as('postBlog');
......
......@@ -7,9 +7,6 @@ context.skip('Comment Permissions', () => {
before(() => {
cy.overrideFeatureFlag({
'allow-comments-toggle': true,
});
//make a post new.
cy.getCookie('minds_sess')
.then((sessionCookie) => {
......
......@@ -31,6 +31,7 @@ context('Registration', () => {
cy.location('pathname').should('eq', '/login');
cy.login(false, username, password);
cy.deleteUser(username, password);
cy.clearCookies();
})
it('should allow a user to register', () => {
......
......@@ -14,11 +14,11 @@ context('Remind', () => {
beforeEach(() => {
cy.preserveCookies();
cy.server();
cy.route("POST", "**/api/v2/newsfeed/remind/*").as("postRemind");
});
it('should allow a user to remind their post', () => {
cy.server();
cy.route("POST", "**/api/v2/newsfeed/remind/*").as("postRemind");
//post
cy.post("test!!");
......@@ -29,13 +29,14 @@ context('Remind', () => {
//fill out text box in modal
cy.get('.m-modal-remind-composer textarea')
.focus()
.clear()
.type(remindText);
//post remind.
cy.get('.m-modal-remind-composer-send i')
.click();
cy.wait('@postRemind').then((xhr) => {
.click()
.wait('@postRemind').then((xhr) => {
expect(xhr.status).to.equal(200);
expect(xhr.response.body.status).to.equal("success");
});
......