...
 
Commits (6)
......@@ -42,11 +42,11 @@ context('Blogs', () => {
cy.get('m-inline-editor .medium-editor-element').type(body);
// click on plus button
//cy.get('.medium-editor-element > .medium-insert-buttons > button.medium-insert-buttons-show').click();
cy.get('.medium-editor-element > .medium-insert-buttons > button.medium-insert-buttons-show').click();
// click on camera
//cy.get('ul.medium-insert-buttons-addons > li > button.medium-insert-action:first-child').contains('photo_camera').click();
cy.get('ul.medium-insert-buttons-addons > li > button.medium-insert-action:first-child').contains('photo_camera').click();
// upload the image
//cy.uploadFile('.medium-media-file-input', '../fixtures/international-space-station-1776401_1920.jpg', 'image/jpg');
cy.uploadFile('.medium-media-file-input', '../fixtures/international-space-station-1776401_1920.jpg', 'image/jpg');
// open license dropdown & select first license
cy.get('.m-license-info select').select('All rights reserved');
......
......@@ -200,90 +200,95 @@ context('Newsfeed', () => {
});
it('should be able to post an activity picking a scheduled date and the edit it', () => {
cy.get('minds-newsfeed-poster').should('be.visible');
cy.get('minds-newsfeed-poster textarea').type('This is a post');
// set scheduled date
cy.get('.m-poster-date-selector__input').click();
cy.get('button.c-datepicker__next').click();
cy.get('tr.c-datepicker__days-row:nth-child(2) td.c-datepicker__day-body:first-child').click();
cy.get('a.c-btn.c-btn--flat.js-ok').click();
// get setted date to compare
let scheduledDate;
cy.get('div.m-poster-date-selector__input div.m-tooltip--bubble')
.invoke('text').then((text) => {
scheduledDate = text;
});
cy.get('.m-posterActionBar__PostButton').click();
cy.wait(100);
// compare setted date with time_created
cy.get('.minds-list > minds-activity:first-child div.mdl-card__supporting-text > div.body > a.permalink > span')
.invoke('text').then((text) => {
const time_created = new Date(text).getTime();
scheduledDate = new Date(scheduledDate).getTime();
expect(scheduledDate).to.equal(time_created);
});
// prepare to listen
cy.server();
cy.route("POST", '**/api/v1/newsfeed/**').as("saveEdited");
// edit the activity
cy.get('.minds-list > minds-activity:first-child m-post-menu > button.minds-more').click();
cy.get('.minds-list > minds-activity:first-child li.mdl-menu__item:first-child').click();
cy.get('.minds-list > minds-activity:first-child .m-poster-date-selector__input').click();
cy.get('button.c-datepicker__next').click();
cy.get('tr.c-datepicker__days-row:nth-child(3) td.c-datepicker__day-body:first-child').click();
cy.get('a.c-btn.c-btn--flat.js-ok').click();
// get setted date to compare
cy.get('.minds-list > minds-activity:first-child div.m-poster-date-selector__input div.m-tooltip--bubble')
.invoke('text').then((text) => {
scheduledDate = text;
});
// compare setted date with time_created
cy.get('.minds-list > minds-activity:first-child div.mdl-card__supporting-text > div.body > a.permalink > span')
.invoke('text').then((text) => {
const time_created = new Date(text).getTime();
scheduledDate = new Date(scheduledDate).getTime();
expect(scheduledDate).to.equal(time_created);
});
// Save
cy.get('.minds-list > minds-activity:first-child button.mdl-button.mdl-button--colored').click();
cy.wait('@saveEdited', { requestTimeout: 5000 }).then((xhr) => {
expect(xhr.status).to.equal(200, '**/api/v1/newsfeed/** request status');
});
// cleanup
cy.get('.minds-list > minds-activity:first-child m-post-menu .minds-more').click();
cy.get('.minds-list > minds-activity:first-child m-post-menu .minds-dropdown-menu .mdl-menu__item:nth-child(4)').click();
cy.get('.minds-list > minds-activity:first-child m-post-menu m-modal-confirm .mdl-button--colored').click();
cy.get('minds-newsfeed-poster').then((poster) => {
if (poster.find('.m-poster-date-selector__input').length > 0) {
cy.get('minds-newsfeed-poster textarea').type('This is a post');
// set scheduled date
cy.get('.m-poster-date-selector__input').click();
cy.get('button.c-datepicker__next').click();
cy.get('tr.c-datepicker__days-row:nth-child(2) td.c-datepicker__day-body:first-child').click();
cy.get('a.c-btn.c-btn--flat.js-ok').click();
// get setted date to compare
let scheduledDate;
cy.get('div.m-poster-date-selector__input div.m-tooltip--bubble')
.invoke('text').then((text) => {
scheduledDate = text;
});
cy.get('.m-posterActionBar__PostButton').click();
cy.wait(100);
// compare setted date with time_created
cy.get('.minds-list > minds-activity:first-child div.mdl-card__supporting-text > div.body > a.permalink > span')
.invoke('text').then((text) => {
const time_created = new Date(text).getTime();
scheduledDate = new Date(scheduledDate).getTime();
expect(scheduledDate).to.equal(time_created);
});
// prepare to listen
cy.server();
cy.route("POST", '**/api/v1/newsfeed/**').as("saveEdited");
// edit the activity
cy.get('.minds-list > minds-activity:first-child m-post-menu > button.minds-more').click();
cy.get('.minds-list > minds-activity:first-child li.mdl-menu__item:first-child').click();
cy.get('.minds-list > minds-activity:first-child .m-poster-date-selector__input').click();
cy.get('button.c-datepicker__next').click();
cy.get('tr.c-datepicker__days-row:nth-child(3) td.c-datepicker__day-body:first-child').click();
cy.get('a.c-btn.c-btn--flat.js-ok').click();
// get setted date to compare
cy.get('.minds-list > minds-activity:first-child div.m-poster-date-selector__input div.m-tooltip--bubble')
.invoke('text').then((text) => {
scheduledDate = text;
});
// compare setted date with time_created
cy.get('.minds-list > minds-activity:first-child div.mdl-card__supporting-text > div.body > a.permalink > span')
.invoke('text').then((text) => {
const time_created = new Date(text).getTime();
scheduledDate = new Date(scheduledDate).getTime();
expect(scheduledDate).to.equal(time_created);
});
// Save
cy.get('.minds-list > minds-activity:first-child button.mdl-button.mdl-button--colored').click();
cy.wait('@saveEdited', { requestTimeout: 5000 }).then((xhr) => {
expect(xhr.status).to.equal(200, '**/api/v1/newsfeed/** request status');
});
// cleanup
cy.get('.minds-list > minds-activity:first-child m-post-menu .minds-more').click();
cy.get('.minds-list > minds-activity:first-child m-post-menu .minds-dropdown-menu .mdl-menu__item:nth-child(4)').click();
cy.get('.minds-list > minds-activity:first-child m-post-menu m-modal-confirm .mdl-button--colored').click();
}
});
})
it('should list scheduled activies', () => {
cy.server();
cy.route("GET", '**/api/v2/feeds/scheduled/**/count?').as("scheduledCount");
cy.route("GET", '**/api/v2/feeds/scheduled/**/activities?**').as("scheduledActivities");
cy.get('minds-newsfeed-poster').then((poster) => {
if (poster.find('.m-poster-date-selector__input').length > 0) {
cy.server();
cy.route("GET", '**/api/v2/feeds/scheduled/**/count?').as("scheduledCount");
cy.route("GET", '**/api/v2/feeds/scheduled/**/activities?**').as("scheduledActivities");
cy.visit(`/${Cypress.env().username}`);
cy.visit(`/${Cypress.env().username}`);
cy.wait('@scheduledCount', { requestTimeout: 2000 }).then((xhr) => {
expect(xhr.status).to.equal(200, 'feeds/scheduled/**/count request status');
});
cy.wait('@scheduledCount', { requestTimeout: 2000 }).then((xhr) => {
expect(xhr.status).to.equal(200, 'feeds/scheduled/**/count request status');
});
cy.get('div.m-mindsListTools__scheduled').click();
cy.get('div.m-mindsListTools__scheduled').click();
cy.wait('@scheduledActivities', { requestTimeout: 2000 }).then((xhr) => {
expect(xhr.status).to.equal(200, 'feeds/scheduled/**/activities request status');
cy.wait('@scheduledActivities', { requestTimeout: 2000 }).then((xhr) => {
expect(xhr.status).to.equal(200, 'feeds/scheduled/**/activities request status');
});
}
});
})
it('should post an activity with an image attachment', () => {
......
......@@ -121,7 +121,7 @@ export class MindsVideoDirectHttpPlayer
try {
player.play();
} catch (e) {
console.error(e);
console.log(e);
}
}
......@@ -131,7 +131,7 @@ export class MindsVideoDirectHttpPlayer
try {
player.pause();
} catch (e) {
console.error(e);
console.log(e);
}
}
......@@ -146,13 +146,14 @@ export class MindsVideoDirectHttpPlayer
}
resumeFromTime(time: number = 0) {
// TODO detect if it's still transcoding
const player = this.getPlayer();
try {
player.currentTime = time;
this.play();
} catch (e) {
console.error(e);
console.log(e);
}
}
......
......@@ -195,7 +195,7 @@ export class MindsVideoTorrentPlayer
this.loadTorrent();
}
} catch (e) {
console.error(e);
console.log(e);
}
}
......@@ -205,7 +205,7 @@ export class MindsVideoTorrentPlayer
try {
player.pause();
} catch (e) {
console.error(e);
console.log(e);
}
}
......@@ -220,6 +220,7 @@ export class MindsVideoTorrentPlayer
}
resumeFromTime(time: number = 0) {
// TODO detect if it's still transcoding
const player = this.getPlayer();
try {
......@@ -234,7 +235,7 @@ export class MindsVideoTorrentPlayer
}
}
} catch (e) {
console.error(e);
console.log(e);
}
}
......
......@@ -183,7 +183,7 @@ export class MindsVideoComponent implements OnDestroy {
}
onError({ player, e }: { player?; e? } = {}) {
console.error('Received error when trying to reproduce video', e, player);
console.log('Received error when trying to reproduce video', e, player);
setTimeout(() => this.fallback(), 0);
}
......
......@@ -18,7 +18,7 @@ m-overlay-modal {
.m-overlay-modal--backdrop {
z-index: 9999995;
@include m-theme() {
background-color: rgba(themed($m-black-always), 0.85);
background-color: rgba(themed($m-black-always), 0.8);
}
}
......@@ -144,9 +144,6 @@ m-overlay-modal {
left: unquote('calc(50% - 50px)');
}
m-video--progress-bar {
.seeker-ball {
top: 4px;
}
.progress-bar {
margin-right: 8px;
}
......
......@@ -27,9 +27,9 @@ export class NewsfeedService {
channel = null,
clientMeta = {}
) {
if (!this.session.isLoggedIn()) {
return;
}
// if (!this.session.isLoggedIn()) {
// return;
// }
// if it's a boost we record the boost view AND the activity view
if (entity.boosted_guid) {
......