Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions scripts/check-live-e2e.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const apiBaseUrl = (
).replace(/\/+$/, '');
const runId = `${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
const password = 'SoundlogLive!2026';
const moderationAdminKey = process.env.LIVE_MODERATION_ADMIN_KEY;
const users = [];
const passedSteps = [];

Expand All @@ -23,6 +24,11 @@ async function request(path, options = {}) {
if (options.token) {
headers.Authorization = `Bearer ${options.token}`;
}
if (options.admin) {
assert(moderationAdminKey, 'LIVE_MODERATION_ADMIN_KEY is required for moderation checks.');
headers['x-soundlog-admin-key'] = moderationAdminKey;
headers['x-soundlog-admin-actor'] = 'live-e2e';
}

if (options.form) {
body = options.form;
Expand Down Expand Up @@ -143,7 +149,7 @@ try {
// steps below (registration, recap captures, etc.).
});

await step('register, login, refresh, profile, and migration', async () => {
await step('register, login, refresh, and profile', async () => {
primary = await registerUser('primary');
companion = await registerUser('companion');

Expand Down Expand Up @@ -177,12 +183,8 @@ try {
assert(me.payload?.data?.profile?.completedOnboarding === true, 'Profile was not completed.');

await request('/v1/me/migrate-local-data', {
body: {
idempotencyKey: `live-migration-${runId}`,
libraryTrackCount: 1,
momentLogCount: 2,
recapDraftCount: 1,
},
body: {},
expectedStatus: 404,
method: 'POST',
token: primary.accessToken,
});
Expand Down Expand Up @@ -377,6 +379,14 @@ try {
recapId = recap.payload?.data?.id;
assert(recapId, 'Travel log was not created.');

for (const contentId of [firstCaptureId, secondCaptureId]) {
await request(`/v1/admin/moderation/content/${contentId}`, {
admin: true,
body: { decision: 'approved', type: 'moment_log' },
method: 'PATCH',
});
}

const mine = await request('/v1/recaps?scope=mine', { token: primary.accessToken });
assert(mine.payload?.data?.some((item) => item.id === recapId), 'Created log is missing.');
const share = await request(`/v1/recaps/${recapId}/share`, {
Expand Down
Loading