How to use the @inkline/inkline/tests/unit/utilities/isServer.isServer function in @inkline/inkline

To help you get started, we’ve selected a few @inkline/inkline 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 inkline / inkline / tests / unit / mixins / components / providers / PopupProviderMixin.spec.js View on Github external
it('should return if Vue.$isServer', () => {
                    isServer(true);

                    expect(wrapper.vm.createPopper()).toEqual(undefined);

                    isServer(false);
                });
github inkline / inkline / tests / unit / components / Pagination.spec.js View on Github external
it('should not add window resize event listener if Vue.$isServer', () => {
                isServer(true, wrapper.vm);

                const spy = jest.spyOn(window, 'addEventListener');

                wrapper.vm.created();

                expect(spy).not.toHaveBeenCalledTimes(3);

                isServer(false, wrapper.vm);
            });
        });
github inkline / inkline / tests / unit / helpers / triggerEvent.spec.js View on Github external
it('should return if Vue.$isServer', () => {
            isServer(true);
            expect(triggerEvent(element, 'eventName')).not.toBeDefined();
            isServer(false);
        });
github inkline / inkline / tests / unit / mixins / components / providers / CollapsibleProviderMixin.spec.js View on Github external
it('should equal 0 if window is not defined', () => {
                    isServer(true);

                    expect(createWrapper().vm.windowWidth).toEqual(0);

                    isServer(false);
                });
            });
github inkline / inkline / tests / unit / helpers / off.spec.js View on Github external
it('should be a function calling detachEventBinding on element', () => {
            isServer(true);

            const spy = jest.spyOn(element, 'detachEvent');
            const fn = () => {};

            _off()(element, 'eventName', fn);

            expect(spy).toHaveBeenCalled();
            expect(spy).toHaveBeenCalledWith('oneventName', fn);

            isServer(false);
        });
github inkline / inkline / tests / unit / directives / click-outside.spec.js View on Github external
it('should not bind mousedown and mouseup events if Vue.$isServer', () => {
                isServer(true);

                const spy = jest.spyOn(window.document, 'addEventListener');

                bindClickOutsideHandler();

                expect(spy).not.toHaveBeenCalledTimes(5);

                isServer(false);
            });
        });
github inkline / inkline / tests / unit / mixins / components / providers / CollapsibleProviderMixin.spec.js View on Github external
it('should not remove window resize event listener if $isServer', () => {
                isServer(true, wrapper.vm);

                const spy = jest.spyOn(window, 'removeEventListener');

                wrapper.vm.beforeDestroy();

                expect(spy).not.toHaveBeenCalled();

                isServer(false, wrapper.vm);
            });
github inkline / inkline / tests / unit / components / Pagination.spec.js View on Github external
it('should not remove window resize event listener if Vue.$isServer', () => {
                isServer(true, wrapper.vm);

                const spy = jest.spyOn(window, 'removeEventListener');

                wrapper.vm.destroyed();

                expect(spy).not.toHaveBeenCalledTimes(3);

                isServer(false, wrapper.vm);
            });
        });
github inkline / inkline / tests / unit / helpers / on.spec.js View on Github external
it('should not call attachEvent binding if event not specified', () => {
            isServer(true);

            const spy = jest.spyOn(element, 'addEventListener');
            const fn = () => {};

            _on()(element, undefined, fn);

            expect(spy).not.toHaveBeenCalled();

            isServer(false);
        });
github inkline / inkline / tests / unit / helpers / isMobile.spec.js View on Github external
it('should return false if SSR', () => {
            isServer(true);

            expect(isMobile()).toEqual(false);

            isServer(false);
        });