mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-26 12:21:36 +03:00
Updated dashboard acceptance tests for latest member graphs/resources box behaviour
refs https://github.com/TryGhost/Team/issues/1376 - adjusted tests so they are in sync with expected dashboard behaviour - removed `dashboardHideGettingStarted` feature and it's usage in the `showMembersGraphs` property as there's no longer a resource box to dismiss
This commit is contained in:
parent
3d8b06847b
commit
9fbb63cf41
@ -36,11 +36,10 @@ export default class DashboardController extends Controller {
|
||||
}
|
||||
|
||||
const hasMembers = this.store.peekAll('member').length > 0;
|
||||
const gettingStartedBannerDismissed = this.feature.dashboardHideGettingStarted === true;
|
||||
|
||||
return this.showMembersData
|
||||
&& this.checkMemberCountTask.performCount > 0
|
||||
&& (hasMembers || gettingStartedBannerDismissed);
|
||||
&& hasMembers;
|
||||
}
|
||||
|
||||
initialise() {
|
||||
|
@ -56,9 +56,6 @@ export default class FeatureService extends Service {
|
||||
@feature('nightShift', {user: true, onChange: '_setAdminTheme'})
|
||||
nightShift;
|
||||
|
||||
@feature('dashboardHideGettingStarted', {user: true})
|
||||
dashboardHideGettingStarted;
|
||||
|
||||
// labs flags
|
||||
@feature('multipleProducts')
|
||||
multipleProducts;
|
||||
|
@ -35,23 +35,20 @@ describe('Acceptance: Dashboard', function () {
|
||||
});
|
||||
|
||||
describe('members graphs', function () {
|
||||
beforeEach(function () {
|
||||
this.server.createList('member', 5);
|
||||
|
||||
// dismiss the getting-started dashboard block
|
||||
const userSettings = JSON.parse(user.accessibility || '{}');
|
||||
userSettings.dashboardHideGettingStarted = true;
|
||||
user.accessibility = JSON.stringify(userSettings);
|
||||
user.save();
|
||||
});
|
||||
|
||||
it('is shown when members exist', async function () {
|
||||
this.server.createList('member', 5);
|
||||
await visit('/dashboard');
|
||||
expect(find('[data-test-dashboard-members-graphs]'), 'members graphs block').to.exist;
|
||||
expect(find('[data-test-dashboard-getting-started]'), 'getting-started resource block').to.not.exist;
|
||||
});
|
||||
|
||||
it('is hidden when no members exist', async function () {
|
||||
this.server.db.members.remove();
|
||||
await visit('/dashboard');
|
||||
expect(find('[data-test-dashboard-members-graphs]'), 'members graphs block').to.not.exist;
|
||||
});
|
||||
|
||||
it('is hidden when members is disabled', async function () {
|
||||
this.server.createList('member', 5);
|
||||
this.server.db.settings.update({key: 'members_signup_access'}, {value: 'none'});
|
||||
|
||||
await visit('/dashboard');
|
||||
|
Loading…
Reference in New Issue
Block a user