Skip to content
Merged
Show file tree
Hide file tree
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
36 changes: 36 additions & 0 deletions apps/self-hosted/src/features/floating-menu/config-fields.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,42 @@ describe('hivesigner client id', () => {
expect(description).toContain('ecency.app');
});

/**
* A managed tenant's client id is written by the registration job, not by the
* owner, so copy telling them to set it themselves describes work they will
* never do and a login they will believe is broken until they do it.
*
* Asserted on the field an owner actually reads rather than on the job, because
* the job being right is what makes this text wrong: the two drifted apart once
* already, with the editor promising a manual step the reconcile had removed.
*/
it('says the hosted case is automatic, and that an own id survives it', () => {
const description = fieldAt(CLIENT_ID_PATH)?.description ?? '';

expect(description).toMatch(/hosted by Ecency/i);
expect(description).toMatch(/filled in for you|automatically/i);
// The reconcile leaves a non-shared value alone; the owner has to be told so,
// or setting their own app reads as a change something else may undo.
expect(description).toMatch(/never overwritten|not be overwritten/i);
});

/**
* The email route is only half an instruction. Nothing writes the field on a
* self-hosted instance: the reconcile iterates the hosting database, so an
* owner who emails us and waits sees the button stay hidden for a step that
* was never going to happen on its own.
*
* `gives both routes to a working setup` does not cover this. It asserts the
* three substrings are present, and they all were in a revision that had
* dropped the save step, which is how this shipped for review.
*/
it('tells a self-hoster taking the email route to save ecency.app themselves', () => {
const description = fieldAt(CLIENT_ID_PATH)?.description ?? '';

expect(description).toMatch(/self-hosted/i);
expect(description).toMatch(/put ecency\.app here/i);
});

it('is pointed at from the login methods field', () => {
expect(fieldAt(METHODS_PATH)?.description).toContain('Hivesigner');
});
Expand Down
4 changes: 2 additions & 2 deletions apps/self-hosted/src/features/floating-menu/config-fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ export const configFieldsMap: Record<string, ConfigField> = {
type: 'array',
allowedValues: AUTH_METHODS,
description:
'Available login methods: keychain, hivesigner, hiveauth. Hivesigner also needs a client id, set under General Settings > Hivesigner.',
'Available login methods: keychain, hivesigner, hiveauth. Hivesigner also needs a client id under General Settings > Hivesigner, which blogs hosted by Ecency are given automatically.',
},
},
},
Expand Down Expand Up @@ -455,7 +455,7 @@ export const configFieldsMap: Record<string, ConfigField> = {
// when cleared, and null erases the stored section on merge.
type: 'string',
description:
"Hivesigner login stays hidden until this is set. Either register your own Hivesigner app and put its id here, or email hello@ecency.com to get this site's /auth address registered on the shared ecency.app app, then put ecency.app here.",
"Hivesigner login stays hidden until this is set. On a blog hosted by Ecency the shared ecency.app app is filled in for you, once this site's /auth address has been registered on chain, so there is normally nothing to do here. To use a different app instead, register your own and put its id here; it is never overwritten. On a self-hosted instance nothing fills this in for you: either register your own app and put its id here, or email hello@ecency.com to get this site's /auth address registered on the shared app and then put ecency.app here.",
},
},
},
Expand Down
Loading