Skip to content

Commit 4ea3aac

Browse files
committed
fix: use name instead of address in community edit example and test
Users should edit the community name (stored in the IPNS record) rather than address (a runtime convenience property). Updated the CLI example, test fixture, and test assertion accordingly.
1 parent 805aee1 commit 4ea3aac

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

src/cli/commands/community/edit.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,9 @@ For modifying complex settings like challenges, consider using a web UI instead:
3737
};
3838

3939
static override examples = [
40-
// TODO update this to change the name instead
41-
// Also are we testing modifying name properly?
42-
// in theory user should not modify address, they should modify name
4340
{
44-
description: "Change the address of the community to a new domain address",
45-
command: "bitsocial community edit 12D3KooWG3XbzoVyAE6Y9vHZKF64Yuuu4TjdgQKedk14iYmTEPWu --address newAddress.bso"
41+
description: "Change the name of the community",
42+
command: "bitsocial community edit 12D3KooWG3XbzoVyAE6Y9vHZKF64Yuuu4TjdgQKedk14iYmTEPWu --name newName.bso"
4643
},
4744
{
4845
description: "Add the author address 'esteban.bso' as an admin on the community",

test/cli/edit.community.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ describe("bitsocial community edit", () => {
3838

3939
it(`Can pass a string value to a first level flag`, async () => {
4040
const { result } = await runEditCommand(
41-
'community edit plebbit.bso --title "new Title" --address newAddress.bso --description "new Description" --pubsubTopic "new Pubsub topic"'
41+
'community edit plebbit.bso --title "new Title" --name newName.bso --description "new Description" --pubsubTopic "new Pubsub topic"'
4242
);
4343
expect(result.error).toBeUndefined();
4444
expect(editFake.calledOnce).toBe(true);
4545
const parsedArgs = <CommunityEditOptions>editFake.args[0][0];
4646
expect(parsedArgs.title).toBe("new Title");
4747
expect(parsedArgs.description).toBe("new Description");
4848
expect(parsedArgs.pubsubTopic).toBe("new Pubsub topic");
49-
expect(parsedArgs.address).toBe("newAddress.bso");
49+
expect(parsedArgs.name).toBe("newName.bso");
5050
});
5151

5252
it(`Can set a string value to a nested prop`, async () => {

test/fixtures/communityForEditFixture.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export const currentSubProps: Partial<CommunityInstance> = {
3737
markdownVideoReplies: false
3838
},
3939
address: "12KWOsomething",
40+
name: "original-community.bso",
4041
rules: ["Rule 1", "Rule 2"],
4142
settings: { challenges: [{ name: "captcha-canvas-v3" }], fetchThumbnailUrls: false, fetchThumbnailUrlsProxyUrl: undefined },
4243
roles: { "rinse12.bso": { role: "admin" }, "estebanabaroa.eth": { role: "admin" }, "plebeius.eth": { role: "moderator" } },

0 commit comments

Comments
 (0)