diff --git a/public/docs/_examples/animations/e2e-spec.ts b/public/docs/_examples/animations/e2e-spec.ts index cd97cedb7e..c7516bce2b 100644 --- a/public/docs/_examples/animations/e2e-spec.ts +++ b/public/docs/_examples/animations/e2e-spec.ts @@ -29,7 +29,7 @@ describe('Animation Tests', () => { }); it('animates between active and inactive', () => { - addHero(); + addInactiveHero(); let li = host.element(by.css('li')); @@ -58,7 +58,7 @@ describe('Animation Tests', () => { }); it('are not kept after animation', () => { - addHero(); + addInactiveHero(); let li = host.element(by.css('li')); @@ -79,7 +79,7 @@ describe('Animation Tests', () => { }); it('animates between active and inactive', () => { - addHero(); + addInactiveHero(); let li = host.element(by.css('li')); @@ -108,7 +108,7 @@ describe('Animation Tests', () => { }); it('animates between active and inactive', () => { - addHero(); + addInactiveHero(); let li = host.element(by.css('li')); @@ -137,7 +137,7 @@ describe('Animation Tests', () => { }); it('adds and removes element', () => { - addHero(); + addInactiveHero(); let li = host.element(by.css('li')); expect(li.getCssValue('transform')).toMatch(NO_TRANSFORM_MATRIX_REGEX); @@ -157,7 +157,7 @@ describe('Animation Tests', () => { }); it('adds and removes and animates between active and inactive', () => { - addHero(); + addInactiveHero(); let li = host.element(by.css('li')); @@ -186,7 +186,7 @@ describe('Animation Tests', () => { }); it('adds and removes element', () => { - addHero(); + addInactiveHero(); let li = host.element(by.css('li')); expect(li.getCssValue('height')).toBe('50px'); @@ -206,7 +206,7 @@ describe('Animation Tests', () => { }); it('adds and removes element', () => { - addHero(); + addInactiveHero(); let li = host.element(by.css('li')); expect(li.getCssValue('transform')).toMatch(NO_TRANSFORM_MATRIX_REGEX); @@ -227,7 +227,7 @@ describe('Animation Tests', () => { }); it('adds and removes element', () => { - addHero(); + addInactiveHero(); let li = host.element(by.css('li')); expect(li.getCssValue('transform')).toMatch(NO_TRANSFORM_MATRIX_REGEX); @@ -248,7 +248,7 @@ describe('Animation Tests', () => { }); it('adds and removes element', () => { - addHero(); + addInactiveHero(); let li = host.element(by.css('li')); expect(li.getCssValue('transform')).toMatch(NO_TRANSFORM_MATRIX_REGEX); @@ -260,8 +260,41 @@ describe('Animation Tests', () => { }); - function addHero() { - element(by.buttonText('Add hero')).click(); + describe('adding active heroes', () => { + + let host: protractor.ElementFinder; + + beforeEach(() => { + host = element(by.css('hero-list-basic')); + }); + + it('animates between active and inactive', () => { + addActiveHero(); + + let li = host.element(by.css('li')); + + expect(getScaleX(li)).toBe(1.1); + expect(li.getCssValue('backgroundColor')).toBe(ACTIVE_COLOR); + + li.click(); + browser.driver.sleep(300); + expect(getScaleX(li)).toBe(1.0); + expect(li.getCssValue('backgroundColor')).toBe(INACTIVE_COLOR); + + li.click(); + browser.driver.sleep(300); + expect(getScaleX(li)).toBe(1.1); + expect(li.getCssValue('backgroundColor')).toBe(ACTIVE_COLOR); + }); + }); + + function addActiveHero() { + element(by.buttonText('Add active hero')).click(); + browser.driver.sleep(500); + } + + function addInactiveHero() { + element(by.buttonText('Add inactive hero')).click(); browser.driver.sleep(500); } diff --git a/public/docs/_examples/animations/ts/app/hero-team-builder.component.ts b/public/docs/_examples/animations/ts/app/hero-team-builder.component.ts index 0fe279188c..0ae7ec519e 100644 --- a/public/docs/_examples/animations/ts/app/hero-team-builder.component.ts +++ b/public/docs/_examples/animations/ts/app/hero-team-builder.component.ts @@ -16,7 +16,8 @@ import { HeroListTimingsComponent } from './hero-list-timings.component'; selector: 'hero-team-builder', template: `