diff --git a/ghost/admin/app/components/members-activity/table-row.hbs b/ghost/admin/app/components/members-activity/table-row.hbs
index 8360724bfa..dfa50c234d 100644
--- a/ghost/admin/app/components/members-activity/table-row.hbs
+++ b/ghost/admin/app/components/members-activity/table-row.hbs
@@ -28,8 +28,10 @@
{{event.join}}
{{event.object}}
{{else if event.url}}
- {{event.join}}
- {{event.object}}
+ {{#if event.object}}
+ {{event.join}}
+ {{event.object}}
+ {{/if}}
{{else if event.email}}
–
diff --git a/ghost/admin/tests/acceptance/members-activity-test.js b/ghost/admin/tests/acceptance/members-activity-test.js
index 782b8e8c86..bc015376c7 100644
--- a/ghost/admin/tests/acceptance/members-activity-test.js
+++ b/ghost/admin/tests/acceptance/members-activity-test.js
@@ -1,6 +1,6 @@
import moment from 'moment-timezone';
import {authenticateSession, invalidateSession} from 'ember-simple-auth/test-support';
-import {click, currentURL, findAll} from '@ember/test-helpers';
+import {click, currentURL, find, findAll} from '@ember/test-helpers';
import {describe, it} from 'mocha';
import {expect} from 'chai';
import {setupApplicationTest} from 'ember-mocha';
@@ -63,10 +63,6 @@ describe('Acceptance: Members activity', function () {
await authenticateSession();
- // this.server.createList('member', 3, {status: 'free'});
- // this.server.createList('member', 4, {status: 'paid'});
- // this.server.createList('member-activity-event', 10, {createdAt: moment('2024-08-18 08:18:08').format('YYYY-MM-DD HH:mm:ss')});
-
// create 1 member with id 1
this.server.create('member', {id: 1, name: 'Member 1', email: '', status: 'free'});
@@ -97,5 +93,59 @@ describe('Acceptance: Members activity', function () {
await click('[data-test-id="event-type-filter-checkbox-payment_event"]');
expect(findAll('.gh-members-activity-event').length).to.equal(1);
});
+
+ it('has a donation event with attribution from homepage and has a dash', async function () {
+ this.server.create('member-activity-event', {
+ memberId: 1,
+ createdAt: moment('2024-08-18 08:18:08').format('YYYY-MM-DD HH:mm:ss'),
+ type: 'donation_event',
+ data: {
+ amount: 500000, // or whatever amount you want to test with
+ currency: 'krw',
+ attribution: {
+ title: 'homepage',
+ url: 'https://example.com'
+ }
+ }
+ });
+
+ await visit('/members-activity');
+
+ const events = findAll('.gh-members-activity-event');
+
+ let donationEvent = null;
+ for (let event of events) {
+ if (event.textContent.includes('homepage')) {
+ donationEvent = event;
+ break;
+ }
+ }
+
+ donationEvent = find('.gh-members-activity-event-join');
+
+ expect(donationEvent.textContent).to.include('–');
+ });
+
+ it('has a donation event without attribution and does not contain a dash', async function () {
+ this.server.create('member-activity-event', {
+ memberId: 1,
+ createdAt: moment('2024-08-18 08:18:08').format('YYYY-MM-DD HH:mm:ss'),
+ type: 'donation_event',
+ data: {
+ amount: 500000, // or whatever amount you want to test with
+ currency: 'krw'
+ }
+ });
+
+ await visit('/members-activity');
+
+ const events = findAll('.gh-members-activity-event');
+
+ const donationEventWithoutAttribution = events[0];
+
+ expect(donationEventWithoutAttribution).to.exist;
+
+ expect(donationEventWithoutAttribution.textContent).to.not.include('–');
+ });
});
});