mirror of
https://github.com/status-im/consul.git
synced 2025-01-09 21:35:52 +00:00
5fb9df1640
* Adding explicit MPL license for sub-package This directory and its subdirectories (packages) contain files licensed with the MPLv2 `LICENSE` file in this directory and are intentionally licensed separately from the BSL `LICENSE` file at the root of this repository. * Adding explicit MPL license for sub-package This directory and its subdirectories (packages) contain files licensed with the MPLv2 `LICENSE` file in this directory and are intentionally licensed separately from the BSL `LICENSE` file at the root of this repository. * Updating the license from MPL to Business Source License Going forward, this project will be licensed under the Business Source License v1.1. Please see our blog post for more details at <Blog URL>, FAQ at www.hashicorp.com/licensing-faq, and details of the license at www.hashicorp.com/bsl. * add missing license headers * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 --------- Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
47 lines
1.3 KiB
JavaScript
47 lines
1.3 KiB
JavaScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
*/
|
|
|
|
import { visit } from '@ember/test-helpers';
|
|
|
|
export default function (scenario, pages, set, reset) {
|
|
scenario
|
|
.when('I visit the $name page', function (name) {
|
|
reset();
|
|
return set(pages[name]).visit();
|
|
})
|
|
.when('I visit the $name page for the "$id" $model', function (name, id, model) {
|
|
reset();
|
|
return set(pages[name]).visit({
|
|
[model]: id,
|
|
});
|
|
})
|
|
.when('I visit the $name page with the url $url', function (name, url) {
|
|
reset();
|
|
set(pages[name]);
|
|
return visit(url);
|
|
})
|
|
.when(
|
|
['I visit the $name page for yaml\n$yaml', 'I visit the $name page for json\n$json'],
|
|
function (name, data) {
|
|
const nspace = this.ctx.nspace;
|
|
if (nspace !== '' && typeof nspace !== 'undefined') {
|
|
data.nspace = `~${nspace}`;
|
|
}
|
|
reset();
|
|
// TODO: Consider putting an assertion here for testing the current url
|
|
// do I absolutely definitely need that all the time?
|
|
return set(pages[name]).visit(data);
|
|
}
|
|
)
|
|
.when(
|
|
['I $method the $name page for yaml\n$yaml', 'I $method the $name page for json\n$json'],
|
|
function (method, name, data) {
|
|
reset();
|
|
|
|
return set(pages[name])[method](data);
|
|
}
|
|
);
|
|
}
|