The tests were using an incorrect value for the site setting (the name of the group instead of the id). `no_ads_for_groups` shows groups names in the UI byt actually stores IDs.
This commit is contained in:
@@ -51,18 +51,10 @@ export default Ember.Component.extend({
|
||||
return true;
|
||||
}
|
||||
|
||||
let noAdsGroups = this.siteSettings.no_ads_for_groups.split("|");
|
||||
|
||||
// TODO: Remove when 2.4 becomes the new stable. This is for backwards compatibility.
|
||||
const groupListUseIDs = this.site.group_list_use_ids;
|
||||
|
||||
let currentGroups = groups;
|
||||
if (groupListUseIDs) {
|
||||
currentGroups = currentGroups.map(g => g.id.toString());
|
||||
} else {
|
||||
currentGroups = currentGroups.map(g => g.name.toLowerCase());
|
||||
noAdsGroups = noAdsGroups.map(g => g.toLowerCase());
|
||||
}
|
||||
let noAdsGroups = this.siteSettings.no_ads_for_groups
|
||||
.split("|")
|
||||
.filter(Boolean);
|
||||
let currentGroups = groups.map(g => g.id.toString());
|
||||
|
||||
return !currentGroups.any(g => noAdsGroups.includes(g));
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user