'use strict';

import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';

chai.use(chaiAsPromised);
let expect = chai.expect;

describe('Board page (desktop)', () => {

    before(() => {
        browser.driver.manage().window().setSize(1280, 768);
    });

    beforeEach(() => {
        browser.get('/');
    });

    describe('static content', () => {
        it('should have right page title', () => {
            expect(browser.getTitle()).to.eventually.equal('BoardOfShame Список мошенников');
        });

        it('should have right h1 caption', () => {
            expect(element(by.css('.board-caption')).getText()).to.eventually.equal('Поиск');
        });

        it('should have right active menu item', () => {
            expect(element(by.css('.navbar .active')).getText()).to.eventually.equal('Список');
        });
    });


    describe('board body', () => {
        it('should contain 11 board items (test table)', () => {
            expect(element.all(by.css('.board-item')).count()).to.eventually.equal(11);
        });
    });

    describe('board footer info', () => {
        it('should contain right info about items', () => {
            expect(element(by.css('.board-footer')).getText()).to.eventually.equal('Всего найдено: 11');
        });
    });

});
@@ -176,16 +176,43 @@
 ) =%3E %7B%0A%0A
+    let searchField = %7B%7D;%0A%0A
     befo
@@ -1317,11 +1317,1350 @@
    %7D);%0A%0A
+    describe('board search filter', () =%3E %7B%0A%0A        beforeEach(() =%3E %7B%0A            searchField = element(by.css('.input-lg'));%0A        %7D);%0A%0A        it('should filter one scammer correctly', () =%3E %7B%0A            searchField.sendKeys('%D0%9C%D0%B8%D1%85%D0%B0%D0%B8%D0%BB %D0%9A%D1%83%D0%BA%D1%83%D1%80%D1%83%D0%B7%D0%BE%D0%B2');%0A%0A            expect(element.all(by.css('.board-item')).count()).to.eventually.equal(1);%0A            expect(element.all(by.css('.board-item')).get(0).getText()).to.eventually.contain('%D0%9C%D0%B8%D1%85%D0%B0%D0%B8%D0%BB %D0%9A%D1%83%D0%BA%D1%83%D1%80%D1%83%D0%B7%D0%BE%D0%B2');%0A            expect(element(by.css('.board-footer')).getText()).to.eventually.equal('%D0%92%D1%81%D0%B5%D0%B3%D0%BE %D0%BD%D0%B0%D0%B9%D0%B4%D0%B5%D0%BD%D0%BE: 1');%0A        %7D);%0A%0A        it('should filter group of scammers correctly', () =%3E %7B%0A            searchField.sendKeys('%D0%BE%D1%80%D0%B0%D0%BA%D0%BB');%0A%0A            expect(element.all(by.css('.board-item')).count()).to.eventually.equal(6);%0A            expect(element.all(by.css('.board-item')).get(5).getText()).to.eventually.contain('%D0%9A%D0%B8%D1%82%D0%B0%D0%B9%D1%81%D0%BA%D0%B8%D0%B5 %D0%BF%D0%BE%D0%B4%D0%B4%D0%B5%D0%BB%D0%BA%D0%B8');%0A            expect(element(by.css('.board-footer')).getText()).to.eventually.equal('%D0%92%D1%81%D0%B5%D0%B3%D0%BE %D0%BD%D0%B0%D0%B9%D0%B4%D0%B5%D0%BD%D0%BE: 6');%0A        %7D);%0A%0A        it('should display right message if nothing was found', () =%3E %7B%0A            searchField.sendKeys('zzzzblablaba');%0A%0A            expect(element.all(by.css('.board-item')).count()).to.eventually.equal(0);%0A%0A            expect(element(by.css('.board-footer')).getText()).to.eventually.equal('%D0%9D%D0%B8%D1%87%D0%B5%D0%B3%D0%BE %D0%BD%D0%B5 %D0%BD%D0%B0%D0%B9%D0%B4%D0%B5%D0%BD%D0%BE');%0A        %7D);%0A    %7D);%0A%0A
 %7D);

Add test for board search filter