Skip to content

Commit

Permalink
feat: update MattermostContainer to set user ID after login and clean…
Browse files Browse the repository at this point in the history
… up console logs
  • Loading branch information
panoramix360 committed Jan 13, 2025
1 parent 40010ef commit a214fe3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
8 changes: 5 additions & 3 deletions demo_plugin_tests/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions dist/mattermostcontainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ class MattermostContainer {
const url = this.url();
const client = new client_1.Client4();
client.setUrl(url);
yield client.login(username, password);
const profile = yield client.login(username, password);
client.setUserId(profile.id);
return client;
});
this.stop = () => __awaiter(this, void 0, void 0, function* () {
Expand Down Expand Up @@ -129,7 +130,6 @@ class MattermostContainer {
withWaitStrategy(testcontainers_1.Wait.forLogMessage('Server is listening on')).
withCopyFilesToContainer(this.configFile).
start();
console.log('container initialized', this.container);
yield this.setSiteURL();
yield this.createAdmin(this.email, this.username, this.password);
yield this.createTeam(this.teamName, this.teamDisplayName);
Expand All @@ -144,7 +144,6 @@ class MattermostContainer {
}
}
yield Promise.all(pluginsToInstall);
console.log('plugins installed', pluginsToInstall);
return this;
});
this.startWithUserSetup = () => __awaiter(this, void 0, void 0, function* () {
Expand Down
3 changes: 2 additions & 1 deletion src/mattermostcontainer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ export default class MattermostContainer {
const url = this.url();
const client = new Client4();
client.setUrl(url);
await client.login(username, password);
const profile = await client.login(username, password);
client.setUserId(profile.id);
return client;
};

Expand Down

0 comments on commit a214fe3

Please sign in to comment.