'use strict';

describe('PIXI.Application', function ()
{
    it('should generate application', function (done)
    {
        expect(PIXI.Application).to.be.a.function;
        const app = new PIXI.Application();

        expect(app.stage).to.be.instanceof(PIXI.Container);
        expect(app.ticker).to.be.instanceof(PIXI.ticker.Ticker);
        expect(app.renderer).to.be.ok;

        app.ticker.addOnce(() =>
        {
            app.destroy();
            done();
        });
    });

    it('should remove canvas when destroyed', function (done)
    {
        const app = new PIXI.Application();
        const view = app.view;

        expect(view).to.be.instanceof(HTMLCanvasElement);
        document.body.appendChild(view);

        app.ticker.addOnce(() =>
        {
            expect(document.body.contains(view)).to.be.true;
            app.destroy(true);
            expect(document.body.contains(view)).to.be.false;
            done();
        });
    });

    it('should not start application before calling start method if options.autoStart is false', function (done)
    {
        const app = new PIXI.Application({ autoStart: false });

        expect(app.ticker.started).to.be.false;
        app.start();

        app.ticker.addOnce(() =>
        {
            app.destroy();
            done();
        });
    });
});

@@ -1328,13 +1328,432 @@
 %0A    %7D);
+%0A%0A    it('should be able to destroy filter manager gracefully', function ()%0A    %7B%0A        const app = new PIXI.Application();%0A%0A        document.body.appendChild(app.view);%0A%0A        const sprite = new PIXI.Sprite(PIXI.Texture.WHITE);%0A%0A        app.stage.addChild(sprite);%0A%0A        const filter = new PIXI.filters.AlphaFilter();%0A%0A        sprite.filters = %5Bfilter%5D;%0A        app.render();%0A%0A        app.destroy(true);%0A    %7D);
 %0A%7D);%0A

update to 0faef4f