"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
Object.defineProperty(exports, "__esModule", { value: true });
const path = require("path");
// tslint:disable:no-implicit-dependencies
const schematics_1 = require("@angular-devkit/schematics");
// tslint:disable-next-line:no-submodule-imports
const testing_1 = require("@angular-devkit/schematics/testing");
describe("Update 4.2.3", () => {
    let appTree;
    const schematicRunner = new testing_1.SchematicTestRunner("ig-migrate", path.join(__dirname, "../migration-collection.json"));
    const configJson = {
        defaultProject: "testProj",
        projects: {
            testProj: {
                sourceRoot: "/src"
            }
        },
        version: 1
    };
    beforeEach(() => {
        appTree = new testing_1.UnitTestTree(new schematics_1.EmptyTree());
        appTree.create("/angular.json", JSON.stringify(configJson));
    });
    it("should add Awesome Grid extra paginator style", (done) => __awaiter(void 0, void 0, void 0, function* () {
        const stylesFile = "/src/app/awesome-grid/awesome-grid.component.scss";
        appTree.create(stylesFile, `@use 'igniteui-angular/theming' as *;

:host ::ng-deep {

  .grid__wrapper {
    @include igx-grid($grid-sample-theme);
  }

  .igx-paginator>* {
    margin: 0 .3125rem;
    display: flex;
    align-items: center;
  }
}
`);
        yield schematicRunner.runSchematicAsync("migration-04", {}, appTree).toPromise();
        expect(appTree.readContent(stylesFile).replace(/\r\n/g, "\n"))
            .toEqual(`@use 'igniteui-angular/theming' as *;

:host ::ng-deep {

  .grid__wrapper {
    @include igx-grid($grid-sample-theme);
  }

  .igx-paginator {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.3125rem 0;
  }

  .igx-paginator>* {
    margin: 0 .3125rem;
    display: flex;
    align-items: center;
  }
}
`.replace(/\r\n/g, "\n"));
        done();
    }));
});
