How to use the @uipath/angular/testing.Key.Space function in @uipath/angular

To help you get started, we’ve selected a few @uipath/angular examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github UiPath / angular-components / projects / angular / components / ui-suggest / src / ui-suggest.component.spec.ts View on Github external
it('should open when pressing Space', () => {
            fixture.detectChanges();

            expect(uiSuggest.isOpen).toBeFalsy();

            fixture.detectChanges();
            const display = fixture.debugElement.query(By.css('.display'));
            display.nativeElement.dispatchEvent(
                EventGenerator.keyUp(Key.Space),
            );

            expect(uiSuggest.isOpen).toBeTruthy();
        });
github UiPath / angular-components / projects / angular / components / ui-grid / src / components / ui-grid-search / ui-grid-search.component.spec.ts View on Github external
it('should clear value if the user presses the SPACE key on the clear button', () => {
                const input = fixture.debugElement.query(By.css('input'));

                input.nativeElement.value = value;
                input.nativeElement.dispatchEvent(EventGenerator.input());

                fixture.detectChanges();

                expect(search.value).not.toEqual('');

                const clear = fixture.debugElement.query(By.css('.ui-grid-search-cancel'));

                clear.nativeElement.dispatchEvent(EventGenerator.keyUp(Key.Space));

                fixture.detectChanges();

                expect(search.value).toEqual('');
            });
github UiPath / angular-components / projects / angular / components / ui-grid / src / ui-grid.component.spec.ts View on Github external
describe('Event: sort change', () => {
            beforeEach(() => {
                fixture.detectChanges();
            });

            const SORT_KEY_EVENTS = [
                EventGenerator.keyUp(Key.Enter),
                EventGenerator.keyUp(Key.Space),
            ];

            const SORT_TRANSITIONS = [
                {
                    from: '',
                    to: 'asc',
                },
                {
                    from: 'asc',
                    to: 'desc',
                },
                {
                    from: 'desc',
                    to: '',
                },
            ];