<commit_before>import {browser, element, by, $$, ExpectedConditions} from 'protractor';
import {expectToExist} from "../utils/asserts";
import {expectPopupBlock} from "../utils/popup";
import {waitForNotPresence, waitForPresence} from "../utils/await";

describe('loading', () => {
    beforeEach(() => {
        browser.waitForAngularEnabled(false);
    });

    describe('test ball loading', () => {
        it('should display correctly', async () => {
            await browser.get('/loading/ball');
            const buttons = element.all(by.css('.jigsaw-button')),
                loadingBlock = element(by.tagName('jigsaw-block')),
                ballsEl = element(by.css('.jigsaw-loading-content')).all(by.tagName('div'));
            buttons.get(0).click();
            await browser.wait(ExpectedConditions.presenceOf(element(by.css('.jigsaw-block-host'))));
            expect(loadingBlock.getCssValue('position')).toBe('absolute');
            expect(loadingBlock.getCssValue('z-index')).toBe('1030');
            await browser.wait(ExpectedConditions.presenceOf(element(by.css('.jigsaw-loading-content'))));
            expect(element(by.css('.jigsaw-loading-content')).getCssValue('width')).toBe('70px');
            expect(element(by.css('.jigsaw-loading-content')).getCssValue('margin-left')).toBe('-35px');
            buttons.get(1).click();
            await waitForNotPresence('.jigsaw-block-host');
            await waitForNotPresence('.jigsaw-loading-content');
            expectToExist('jigsaw-block', false);
            expectToExist('.jigsaw-ball-loading-host', false);
            buttons.get(2).click();
            expectToExist(ballsEl.get(0));
            await browser.wait(ExpectedConditions.presenceOf(element(by.css('.jigsaw-block-host'))));
            expectToExist('.jigsaw-block-host');
            await browser.wait(ExpectedConditions.presenceOf(element(by.css('.jigsaw-loading-content'))));
            expectToExist('.jigsaw-loading-content');
        })
    });

    describe('test bubble loading', () => {
        it('should display correctly', async () => {
            await browser.get('/loading/bubble');
            const buttons = element.all(by.css('.jigsaw-button')),
                bubbles = element(by.css('.container1')).all(by.tagName('div'));
            buttons.get(0).click();
            await browser.wait(ExpectedConditions.presenceOf(element(by.css('.jigsaw-block-host'))));
            await browser.wait(ExpectedConditions.presenceOf(element(by.css('.container1'))));
            buttons.get(1).click();
            await waitForNotPresence('.container1');
            expectToExist('.jigsaw-bubble-loading-host', false);
            buttons.get(3).click();
            await waitForPresence('.jigsaw-button .jigsaw-bubble-loading-host');
            expectToExist('.jigsaw-button .jigsaw-bubble-loading-host', true);
        })
    });

    describe('test loading color', () => {
        it('should display color correctly', () => {
            browser.get('/loading/color');
            const bubbleEls = $$('jigsaw-bubble-loading');
            expect(bubbleEls.get(0).$('.spinner .circle1').getCssValue('background-color')).toBe('rgba(255, 0, 0, 1)');
            expect(bubbleEls.get(1).$('.spinner .circle1').getCssValue('background-color')).toBe('rgba(255, 165, 0, 1)');
            expect(bubbleEls.get(2).$('.spinner .circle1').getCssValue('background-color')).toBe('rgba(255, 255, 0, 1)');
            expect(bubbleEls.get(3).$('.spinner .circle1').getCssValue('background-color')).toBe('rgba(0, 255, 0, 1)');
        })
    });

    describe('test loading full', () => {
        it('input should be disabled after click submit', async() => {
            browser.get('/loading/full');
            const submitEls = $$('.jigsaw-button-color-primary'),
                testInput = $$('.content-box').get(1).$$('.content-line').get(0).$('input');
            submitEls.get(1).click();
            await waitForPresence('.jigsaw-button-clicked');
            await waitForNotPresence('.jigsaw-button-clicked');
            expect(testInput.getAttribute('ng-reflect-is-disabled')).toBe('true');
        })
    })
});<commit_msg>fixed timeout<commit_after>import {browser, element, by, $$, ExpectedConditions} from 'protractor';
import {expectToExist} from "../utils/asserts";
import {expectPopupBlock} from "../utils/popup";
import {waitForNotPresence, waitForPresence} from "../utils/await";

describe('loading', () => {
    beforeEach(() => {
        browser.waitForAngularEnabled(false);
    });

    describe('test ball loading', () => {
        it('should display correctly', async () => {
            await browser.get('/loading/ball');
            const buttons = element.all(by.css('.jigsaw-button')),
                loadingBlock = element(by.tagName('jigsaw-block')),
                ballsEl = element(by.css('.jigsaw-loading-content')).all(by.tagName('div'));
            buttons.get(0).click();
            await browser.wait(ExpectedConditions.presenceOf(element(by.css('.jigsaw-block-host'))));
            expect(loadingBlock.getCssValue('position')).toBe('absolute');
            expect(loadingBlock.getCssValue('z-index')).toBe('1030');
            await browser.wait(ExpectedConditions.presenceOf(element(by.css('.jigsaw-loading-content'))));
            expect(element(by.css('.jigsaw-loading-content')).getCssValue('width')).toBe('70px');
            expect(element(by.css('.jigsaw-loading-content')).getCssValue('margin-left')).toBe('-35px');
            buttons.get(1).click();
            await waitForNotPresence('.jigsaw-block-host');
            await waitForNotPresence('.jigsaw-loading-content');
            expectToExist('jigsaw-block', false);
            expectToExist('.jigsaw-ball-loading-host', false);
            buttons.get(2).click();
            await browser.wait(ExpectedConditions.presenceOf(element(by.css('.jigsaw-block-host'))));
            await browser.wait(ExpectedConditions.presenceOf(element(by.css('.jigsaw-loading-content'))));
            expectToExist('.jigsaw-block-host');
            expectToExist('.jigsaw-loading-content');
        })
    });

    describe('test bubble loading', () => {
        it('should display correctly', async () => {
            await browser.get('/loading/bubble');
            const buttons = element.all(by.css('.jigsaw-button')),
                bubbles = element(by.css('.container1')).all(by.tagName('div'));
            buttons.get(0).click();
            await browser.wait(ExpectedConditions.presenceOf(element(by.css('.jigsaw-block-host'))));
            await browser.wait(ExpectedConditions.presenceOf(element(by.css('.container1'))));
            buttons.get(1).click();
            await waitForNotPresence('.container1');
            expectToExist('.jigsaw-bubble-loading-host', false);
            buttons.get(3).click();
            await waitForPresence('.jigsaw-button .jigsaw-bubble-loading-host');
            expectToExist('.jigsaw-button .jigsaw-bubble-loading-host', true);
        })
    });

    describe('test loading color', () => {
        it('should display color correctly', () => {
            browser.get('/loading/color');
            const bubbleEls = $$('jigsaw-bubble-loading');
            expect(bubbleEls.get(0).$('.spinner .circle1').getCssValue('background-color')).toBe('rgba(255, 0, 0, 1)');
            expect(bubbleEls.get(1).$('.spinner .circle1').getCssValue('background-color')).toBe('rgba(255, 165, 0, 1)');
            expect(bubbleEls.get(2).$('.spinner .circle1').getCssValue('background-color')).toBe('rgba(255, 255, 0, 1)');
            expect(bubbleEls.get(3).$('.spinner .circle1').getCssValue('background-color')).toBe('rgba(0, 255, 0, 1)');
        })
    });

    describe('test loading full', () => {
        it('input should be disabled after click submit', async() => {
            browser.get('/loading/full');
            const submitEls = $$('.jigsaw-button-color-primary'),
                testInput = $$('.content-box').get(1).$$('.content-line').get(0).$('input');
            submitEls.get(1).click();
            await waitForNotPresence('.jigsaw-button-clicked');
            expect(testInput.getAttribute('ng-reflect-is-disabled')).toBe('true');
        })
    })
});
{'fraction_non_alphanumeric': 0.18746987951807229, 'fraction_numerical': 0.013614457831325302, 'mean_word_length': 2.8484005563282335, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5917423', 'n_tokens_mistral': 2480, 'n_tokens_neox': 2467, 'n_words': 298}