<commit_before>/* eslint-disable newline-per-chained-call */

import {browser} from 'protractor';

import {monitoring} from './helpers/monitoring';
import {workspace} from './helpers/workspace';
import {content} from './helpers/content';
import {nav} from './helpers/utils';

describe('spike', () => {
    beforeEach((done) => {
        nav('/workspace/content').then(done);
    });

    it('can spike item', () => {
        workspace.switchToDesk('PERSONAL');
        content.setListView();

        var personalCount;

        content.getItems().count().then((count) => {
            personalCount = count;
        });

        content.actionOnItem('Spike Item', 0, null, true);

        // check that there are less items than before
        browser.wait(() => content.getItems().count().then((count) => count < personalCount), 3000);
    });

    it('can spike and unspike multiple items', () => {
        monitoring.openMonitoring();

        monitoring.selectItem(2, 2);
        monitoring.selectItem(2, 3);

        content.spikeItems();

        monitoring.showSpiked();
        expect(monitoring.getAllItems().count()).toBe(2);

        content.selectItem(0);
        content.selectItem(1);
        content.unspikeItems();

        expect(monitoring.getAllItems().count()).toBe(0);
    });
});
<commit_msg>fix test "can spike and unspike multiple items" (#3720)<commit_after>/* eslint-disable newline-per-chained-call */

import {browser} from 'protractor';

import {monitoring} from './helpers/monitoring';
import {workspace} from './helpers/workspace';
import {content} from './helpers/content';
import {nav} from './helpers/utils';
import {ECE, els, el} from 'end-to-end-testing-helpers';

describe('spike', () => {
    beforeEach((done) => {
        nav('/workspace/content').then(done);
    });

    it('can spike item', () => {
        workspace.switchToDesk('PERSONAL');
        content.setListView();

        var personalCount;

        content.getItems().count().then((count) => {
            personalCount = count;
        });

        content.actionOnItem('Spike Item', 0, null, true);

        // check that there are less items than before
        browser.wait(() => content.getItems().count().then((count) => count < personalCount), 3000);
    });

    it('can spike and unspike multiple items', () => {
        monitoring.openMonitoring();

        monitoring.selectItem(2, 2);
        monitoring.selectItem(2, 3);

        content.spikeItems();

        monitoring.showSpiked();
        browser.wait(
            ECE.hasElementCount(
                els(['article-item'], null, el(['articles-list'])),
                2,
            ),
        );

        content.selectItem(0);
        content.selectItem(1);
        content.unspikeItems();

        browser.wait(
            ECE.hasElementCount(
                els(['article-item'], null, el(['articles-list'])),
                0,
            ),
        );
    });
});

{'fraction_non_alphanumeric': 0.16683621566632756, 'fraction_numerical': 0.01017293997965412, 'mean_word_length': 2.458382180539273, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, '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': '2052121', 'n_tokens_mistral': 880, 'n_tokens_neox': 840, 'n_words': 168}