"use strict";
// © 2022 SolarWinds Worldwide, LLC. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
//  of this software and associated documentation files (the "Software"), to
//  deal in the Software without restriction, including without limitation the
//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
//  sell copies of the Software, and to permit persons to whom the Software is
//  furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
//  all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
//  THE SOFTWARE.
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const testing_1 = require("@angular-devkit/schematics/testing");
const path = tslib_1.__importStar(require("path"));
const collectionPath = path.join(__dirname, "../collection.json");
xdescribe("ng-generate filtered-view", () => {
    const runner = new testing_1.SchematicTestRunner("schematics", collectionPath);
    let beforeTree; // tslint:disable-line
    beforeEach(() => {
        beforeTree.create("package.json", JSON.stringify({
            dependencies: {},
            devDependencies: {},
        }));
        beforeTree.create(`tsconfig.json`, "{}");
    });
    it("adds files", () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
        var _a;
        beforeTree.create("angular.json", JSON.stringify({
            projects: {
                lib: {
                    architect: {
                        build: {
                            options: {},
                        },
                    },
                },
            },
            newProjectRoot: "",
            defaultProject: "lib",
        }));
        const afterTree = yield runner
            .runSchematicAsync("filtered-view", { name: "foo", project: "lib" }, beforeTree)
            .toPromise();
        const fileContents = (_a = afterTree
            .read("foo/foo.component.ts")) === null || _a === void 0 ? void 0 : _a.toString("utf-8");
        expect(fileContents).toContain("export class FooComponent");
        expect(afterTree.files.includes("/foo/foo.component.html")).toEqual(true);
    }));
});
//# sourceMappingURL=index.spec.js.map