The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/packages/apps-engine/tests/server/managers/AppSlashCommand.spec.ts

29 lines
912 B

import { Expect, SetupFixture, Test } from 'alsatian';
import type { ISlashCommand } from '../../../src/definition/slashcommands';
import type { ProxiedApp } from '../../../src/server/ProxiedApp';
import { AppSlashCommand } from '../../../src/server/managers/AppSlashCommand';
export class AppSlashCommandRegistrationTestFixture {
private mockApp: ProxiedApp;
@SetupFixture
public setupFixture() {
this.mockApp = {} as ProxiedApp;
}
@Test()
public ensureAppSlashCommand() {
Expect(() => new AppSlashCommand(this.mockApp, {} as ISlashCommand)).not.toThrow();
const ascr = new AppSlashCommand(this.mockApp, {} as ISlashCommand);
Expect(ascr.isRegistered).toBe(false);
Expect(ascr.isEnabled).toBe(false);
Expect(ascr.isDisabled).toBe(false);
ascr.hasBeenRegistered();
Expect(ascr.isDisabled).toBe(false);
Expect(ascr.isEnabled).toBe(true);
Expect(ascr.isRegistered).toBe(true);
}
}