Explicitly sort by Key after folder/file

This commit is contained in:
John Cowen 2018-06-07 14:15:44 +01:00
parent e34eec4bef
commit b29d2acb08
4 changed files with 86 additions and 1 deletions

View File

@ -35,7 +35,7 @@
{{#block-slot 'content'}} {{#block-slot 'content'}}
{{#if (gt filtered.length 0)}} {{#if (gt filtered.length 0)}}
{{#tabular-collection {{#tabular-collection
items=(sort-by 'isFolder:desc' filtered) as |item index| items=(sort-by 'isFolder:desc' 'Key:asc' filtered) as |item index|
}} }}
{{#block-slot 'header'}} {{#block-slot 'header'}}
<th>Name</th> <th>Name</th>

View File

@ -0,0 +1,56 @@
@setupApplicationTest
Feature: dc / kvs / list-order
In order to be able to find key values easier
As a user
I want to see the Key/Values listed alphabetically
Scenario: I have 19 folders
Given 1 datacenter model with the value "datacenter"
And 19 kv models from yaml
---
- __secretzzz/
- a-thing-service/
- a-thing-y-again-service/
- a-thing-y-againzz-service/
- a-z-search-service/
- blood-pressure-service/
- callToAction-items/
- configuration/
- content-service/
- currentRepository-jobs/
- currentRepository-service/
- first-service/
- logs-service/
- rabmq-svc/
- rabmqUtilities/
- schedule-service/
- vanApp-service/
- vanCat-service/
- vanTaxi-service/
---
When I visit the kvs page for yaml
---
dc: datacenter
---
Then I see name on the kvs like yaml
---
- __secretzzz/
- a-thing-service/
- a-thing-y-again-service/
- a-thing-y-againzz-service/
- a-z-search-service/
- blood-pressure-service/
- callToAction-items/
- configuration/
- content-service/
- currentRepository-jobs/
- currentRepository-service/
- first-service/
- logs-service/
- rabmq-svc/
- rabmqUtilities/
- schedule-service/
- vanApp-service/
- vanCat-service/
- vanTaxi-service/
---

View File

@ -0,0 +1,10 @@
import steps from '../../steps';
// step definitions that are shared between features should be moved to the
// tests/acceptance/steps/steps.js file
export default function(assert) {
return steps(assert).then('I should find a file', function() {
assert.ok(true, this.step);
});
}

View File

@ -205,6 +205,25 @@ export default function(assert) {
`Expected ${num} ${model}s with ${property} set to "${value}", saw ${len}` `Expected ${num} ${model}s with ${property} set to "${value}", saw ${len}`
); );
}) })
.then('I see $property on the $component like yaml\n$yaml', function(
property,
component,
yaml
) {
const _component = currentPage[component];
const iterator = new Array(_component.length).fill(true);
iterator.forEach(function(item, i, arr) {
const actual = _component.objectAt(i)[property];
const expected = yaml[i];
assert.deepEqual(
actual,
expected,
`Expected to see ${property} on ${component}[${i}] as ${JSON.stringify(
expected
)}, was ${JSON.stringify(actual)}`
);
});
})
.then(['I see $property on the $component'], function(property, component) { .then(['I see $property on the $component'], function(property, component) {
assert.ok(currentPage[component][property], `Expected to see ${property} on ${component}`); assert.ok(currentPage[component][property], `Expected to see ${property} on ${component}`);
}) })