1
1
/* eslint-disable ember-a11y-testing/a11y-audit-called */ // Covered in behaviours/fs
2
- import { module , test } from 'qunit' ;
2
+ import { module } from 'qunit' ;
3
3
import { setupApplicationTest } from 'ember-qunit' ;
4
4
5
5
import setupMirage from 'ember-cli-mirage/test-support/setup-mirage' ;
6
- import Response from 'ember-cli-mirage/response' ;
7
6
8
7
import browseFilesystem from './behaviors/fs' ;
9
8
10
- import FS from 'nomad-ui/tests/pages/allocations/fs' ;
11
-
12
9
let allocation ;
13
10
let task ;
14
11
let files , taskDirectory , directory , nestedDirectory ;
@@ -37,10 +34,18 @@ module('Acceptance | task fs', function(hooks) {
37
34
files . push ( taskDirectory ) ;
38
35
39
36
// Nested files
40
- directory = server . create ( 'allocFile' , { isDir : true , name : 'directory' , parent : taskDirectory } ) ;
37
+ directory = server . create ( 'allocFile' , {
38
+ isDir : true ,
39
+ name : 'directory' ,
40
+ parent : taskDirectory ,
41
+ } ) ;
41
42
files . push ( directory ) ;
42
43
43
- nestedDirectory = server . create ( 'allocFile' , { isDir : true , name : 'another' , parent : directory } ) ;
44
+ nestedDirectory = server . create ( 'allocFile' , {
45
+ isDir : true ,
46
+ name : 'another' ,
47
+ parent : directory ,
48
+ } ) ;
44
49
files . push ( nestedDirectory ) ;
45
50
46
51
files . push (
@@ -51,7 +56,9 @@ module('Acceptance | task fs', function(hooks) {
51
56
} )
52
57
) ;
53
58
54
- files . push ( server . create ( 'allocFile' , { isDir : true , name : 'empty-directory' , parent : taskDirectory } ) ) ;
59
+ files . push (
60
+ server . create ( 'allocFile' , { isDir : true , name : 'empty-directory' , parent : taskDirectory } )
61
+ ) ;
55
62
files . push ( server . create ( 'allocFile' , 'file' , { fileType : 'txt' , parent : taskDirectory } ) ) ;
56
63
files . push ( server . create ( 'allocFile' , 'file' , { fileType : 'txt' , parent : taskDirectory } ) ) ;
57
64
@@ -60,29 +67,11 @@ module('Acceptance | task fs', function(hooks) {
60
67
this . nestedDirectory = nestedDirectory ;
61
68
} ) ;
62
69
63
- test ( 'when the task is not running, an empty state is shown' , async function ( assert ) {
64
- // The API 500s on stat when not running
65
- this . server . get ( '/client/fs/stat/:allocation_id' , ( ) => {
66
- return new Response ( 500 , { } , 'no such file or directory' ) ;
67
- } ) ;
68
-
69
- task . update ( {
70
- finishedAt : new Date ( ) ,
71
- } ) ;
72
-
73
- await FS . visitTask ( { id : allocation . id , name : task . name } ) ;
74
- assert . ok ( FS . hasEmptyState , 'Non-running task has no files' ) ;
75
- assert . ok (
76
- FS . emptyState . headline . includes ( 'Task is not Running' ) ,
77
- 'Empty state explains the condition'
78
- ) ;
79
- } ) ;
80
-
81
70
browseFilesystem ( {
82
- visitSegments : ( { allocation, task} ) => ( { id : allocation . id , name : task . name } ) ,
83
- getExpectedPathBase : ( { allocation, task} ) => `/allocations/${ allocation . id } /${ task . name } /fs/` ,
84
- getTitleComponent : ( { task} ) => `Task ${ task . name } filesystem` ,
85
- getBreadcrumbComponent : ( { task} ) => task . name ,
71
+ visitSegments : ( { allocation, task } ) => ( { id : allocation . id , name : task . name } ) ,
72
+ getExpectedPathBase : ( { allocation, task } ) => `/allocations/${ allocation . id } /${ task . name } /fs/` ,
73
+ getTitleComponent : ( { task } ) => `Task ${ task . name } filesystem` ,
74
+ getBreadcrumbComponent : ( { task } ) => task . name ,
86
75
getFilesystemRoot : ( { task } ) => task . name ,
87
76
pageObjectVisitFunctionName : 'visitTask' ,
88
77
pageObjectVisitPathFunctionName : 'visitTaskPath' ,
0 commit comments