github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/ui/tests/pages/allocations/fs.js (about) 1 import { 2 attribute, 3 collection, 4 clickable, 5 create, 6 hasClass, 7 isPresent, 8 text, 9 visitable, 10 } from 'ember-cli-page-object'; 11 12 export default create({ 13 visitAllocation: visitable('/allocations/:id/fs'), 14 visitAllocationPath: visitable('/allocations/:id/fs/:path'), 15 16 visitTask: visitable('/allocations/:id/:name/fs'), 17 visitTaskPath: visitable('/allocations/:id/:name/fs/:path'), 18 19 fileViewer: { 20 scope: '[data-test-file-viewer]', 21 }, 22 23 breadcrumbsText: text('[data-test-fs-breadcrumbs]'), 24 25 breadcrumbs: collection('[data-test-fs-breadcrumbs] li', { 26 visit: clickable('a'), 27 path: attribute('href', 'a'), 28 isActive: hasClass('is-active'), 29 }), 30 31 sortOptions: collection('[data-test-sort-by]', { 32 id: attribute('data-test-sort-by'), 33 sort: clickable(), 34 }), 35 36 sortBy(id) { 37 return this.sortOptions.toArray().findBy('id', id).sort(); 38 }, 39 40 directoryEntries: collection('[data-test-entry]', { 41 name: text('[data-test-name]'), 42 43 isFile: isPresent('.icon-is-file-outline'), 44 isDirectory: isPresent('.icon-is-folder-outline'), 45 46 size: text('[data-test-size]'), 47 lastModified: text('[data-test-last-modified]'), 48 49 visit: clickable('a'), 50 path: attribute('href', 'a'), 51 }), 52 53 isEmptyDirectory: isPresent('[data-test-empty-directory]'), 54 55 directoryEntryNames() { 56 return this.directoryEntries.toArray().mapBy('name'); 57 }, 58 59 hasEmptyState: isPresent('[data-test-not-running]'), 60 emptyState: { 61 headline: text('[data-test-not-running-headline]'), 62 }, 63 64 error: { 65 title: text('[data-test-error-title]'), 66 }, 67 });