open-consul/ui/packages/consul-ui/tests/steps/doubles/http.js
John Cowen dc183b1786
ui: Restrict the viewing/editing of certain UI elements based on the users ACLs (#9687)
This commit use the internal authorize endpoint along wiht ember-can to further restrict user access to certain UI features and navigational elements depending on the users ACL token
2021-02-19 16:42:16 +00:00

19 lines
636 B
JavaScript

export default function(scenario, respondWith, set) {
// respondWith should set the url to return a certain response shape
scenario
.given(['the url "$endpoint" responds with a $status status'], function(url, status) {
respondWith(url, {
status: parseInt(status),
});
})
.given(['the url "$endpoint" responds with from yaml\n$yaml'], function(url, data) {
if (typeof data.body !== 'string') {
data.body = JSON.stringify(data.body);
}
respondWith(url, data);
})
.given('a network latency of $number', function(number) {
set('CONSUL_LATENCY', number);
});
}