...
 
Commits (7)
// import 'cypress-file-upload';
context('Blogs', () => {
const closeButton = '[data-cy=data-minds-conversation-close]';
before(() => {
cy.getCookie('minds_sess')
.then((sessionCookie) => {
......@@ -8,6 +11,14 @@ context('Blogs', () => {
return cy.login(true);
}
});
// ensure no messenger windows are open.
cy.get('body').then(($body) => {
if ($body.find(closeButton).length) {
cy.get(closeButton)
.click({multiple: true});
}
});
});
beforeEach(() => {
......@@ -208,7 +219,7 @@ context('Blogs', () => {
cy.get('.m-blog--title').contains(title);
cy.get('.minds-blog-body p').contains(body);
};
it('should not be able to create a new blog if no title or banner are specified', () => {
cy.visit('/blog/edit/new');
cy.get('.m-button--submit').click();
......
......@@ -37,8 +37,6 @@ export class SidebarSelectorComponent implements OnInit {
showExtendedList: boolean = false;
showTrending: boolean = false;
protected lastPreferredEmission: boolean;
constructor(
protected topbarHashtagsService: TopbarHashtagsService,
protected changeDetectorRef: ChangeDetectorRef,
......@@ -46,7 +44,9 @@ export class SidebarSelectorComponent implements OnInit {
) {}
ngOnInit() {
this.lastPreferredEmission = this.preferred;
this.preferred = this.storage.get('preferred_hashtag_state')
? this.storage.get('preferred_hashtag_state') === '1'
: false;
this.init();
}
......@@ -131,15 +131,11 @@ export class SidebarSelectorComponent implements OnInit {
});
} else {
this.currentHashtag = null;
this.preferred = this.lastPreferredEmission;
this.preferredChange();
}
}
preferredChange() {
this.lastPreferredEmission = this.preferred;
this.storage.set('preferred_hashtag_state', this.preferred ? '1' : '0');
this.filterChange.emit({
type: this.preferred ? 'preferred' : 'all',
});
......
......@@ -113,7 +113,10 @@ export class NewsfeedSortedComponent implements OnInit, OnDestroy {
if (typeof params['hashtag'] !== 'undefined') {
this.hashtag = params['hashtag'] || null;
this.all = false;
} else if (typeof params['all'] !== 'undefined') {
} else if (
typeof params['all'] !== 'undefined' ||
this.storage.get('preferred_hashtag_state') !== '1'
) {
this.hashtag = null;
this.all = true;
} else if (params['query']) {
......
......@@ -95,7 +95,6 @@
<m-hashtags--sidebar-selector
[disabled]="!isSorted"
[currentHashtag]="hashtag"
[preferred]="!all && !hashtag"
(filterChange)="hashtagFilterChange($event)"
(switchAttempt)="navigateToGlobal()"
></m-hashtags--sidebar-selector>
......@@ -211,7 +210,6 @@
[compact]="true"
[disabled]="!isSorted"
[currentHashtag]="hashtag"
[preferred]="!all && !hashtag"
(filterChange)="hashtagFilterChange($event)"
(switchAttempt)="navigateToGlobal()"
></m-hashtags--sidebar-selector>
......
......@@ -551,7 +551,7 @@
</div>
<div
class="m-proSettings__row--input"
*ngIf="form.value.hashtags.length > 0"
*ngIf="form.value.hashtags.length > -1"
>
<m-draggableList
[headers]="['Label', '#Hashtag']"
......