'use strict'

describe('Player', function() {
    describe('with particular flashcard given', function() {
        beforeEach(function() {
            browser().navigateTo('/');
            restartDB();
            sleep(0.3);
            browser().navigateTo('/#/Player/someFlashcardListId1/someId2');
        });

        it('should not go to the first flashcard in the list', function() {
            // then
            expect(browser().window().hash()).toBe('/Player/someFlashcardListId1/someId2');
        });

        it('should display the contents of the card by default', function() {
            expect(element('.flashcard-contents').html()).toContain('<strong>front 2</strong>');
        });

    });

    describe('with no flashcard given', function() {
        beforeEach(function() {
            browser().navigateTo('/');
            restartDB();
            sleep(0.3);
            browser().navigateTo('/#/Player/someFlashcardListId1');
        });

        it('should go to the first flashcard in the list', function() {
            // then
            expect(browser().window().hash()).toBe('/Player/someFlashcardListId1/someId1');
        });

        it('should display the contents of the card by default', function() {
            expect(element('.flashcard-contents').html()).toContain('<em>front 1</em>');
        });

        it('should show the back of the card', function() {
            // when
            element('.flashcard-buttons .show-back:button').click();

            // then
            expect(element('.flashcard-contents').html()).toContain('<em>back 1</em>');
        });
    });

});

@@ -1382,16 +1382,41 @@
 the card
+ upon clicking the button
 ', funct
@@ -1633,16 +1633,391 @@
     %7D);%0A
+%0A        it('should show the foront of the card upon clicking the button twice', function() %7B%0A            // when%0A            element('.flashcard-buttons .show-back:button').click();%0A            element('.flashcard-buttons .show-back:button').click();%0A%0A            // then%0A            expect(element('.flashcard-contents').html()).toContain('%3Cem%3Efront 1%3C/em%3E');%0A        %7D);%0A%0A
     %7D);%0A

Add e2e test for switching the flashcard over