import {Dropdown} from '../Dropdown'; import {DropdownCreationOptions} from '../DropdownCreationOptions'; /** * An implementation of Dropdown. */ export class TestDropdown implements Dropdown { id: string; options: DropdownCreationOptions; x: number = -1; y: number = -1; width: number = -1; open: boolean = false; constructor(options: DropdownCreationOptions) { this.id = 'test-message-' + (new Date()).getMilliseconds(); this.options = options; } close(): void { this.open = false; } isOpen(): boolean { return this.open; } showAt(x: number, y: number, width: number): void { this.x = x; this.y = y; this.width = width; this.open = true; } /** * This method opens or closes a dropdown menu. * @param open */ setOpen(open: boolean): void { this.open = open; } getId(): string { return this.id; } }