John Cowen 6c240fbf2d
ui: Ensure service instance data does not get re-written on blocking refresh (#11903)
* Add some less fake API data

* Rename the models class so as to not be confused with JS Proxies

* Rearrange routlets slightly and add some initial outletFor tests

* Move away from a MeshChecks computed property and just use a helper

* Just use ServiceChecks for healthiness filtering for the moment

* Make TProxy cookie configurable

* Amend exposed paths and upstreams so they know about meta AND proxy

* Slight bit of TaggedAddresses refactor while I was checking for `meta` etc

* Document CONSUL_TPROXY_ENABLE
2022-01-07 19:16:21 +00:00

33 lines
892 B
JavaScript

import { moduleFor, test } from 'ember-qunit';
moduleFor('service:routlet', 'Integration | Routlet', {
// Specify the other units that are required for this test.
integration: true,
});
test('outletFor works', function(assert) {
const routlet = this.subject();
routlet.addOutlet('application', {
name: 'application'
});
routlet.addRoute('dc', {});
routlet.addOutlet('dc', {
name: 'dc'
});
routlet.addRoute('dc.services', {});
routlet.addOutlet('dc.services', {
name: 'dc.services'
});
routlet.addRoute('dc.services.instances', {});
let actual = routlet.outletFor('dc.services');
let expected = 'dc';
assert.equal(actual.name, expected);
actual = routlet.outletFor('dc');
expected = 'application';
assert.equal(actual.name, expected);
actual = routlet.outletFor('application');
expected = undefined;
assert.equal(actual, expected);
});