All Downloads are FREE. Search and download functionalities are using the official Maven repository.

src.app.testing.activated-route-stub.ts Maven / Gradle / Ivy

The newest version!
/*
 * SPDX-FileCopyrightText: 2017-2024 Enedis
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 */

import { of } from 'rxjs';
import { convertToParamMap } from '@angular/router';

export class ActivatedRouteStub {

    params = of({});
    queryParams = of({});

    snapshot = {
        queryParamMap: {},
        _lastPathIndex: 0
    };

    constructor() {
    }

    setParamMap(params?: Object) {
        this.params = of(params);
        this.queryParams = of(params);
    }

    setSnapshotQueryParamMap(params?: Object) {
        this.snapshot.queryParamMap = convertToParamMap(params);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy