@@ -27,24 +27,35 @@ function commit (fileListViewModel, msg) {
27
27
28
28
describe ( 'GitPackage' , function ( ) {
29
29
let gitPackage
30
- let repo
31
30
32
31
beforeEach ( async ( ) => {
33
- jasmine . useRealClock ( )
34
-
35
- repo = copyRepository ( )
36
- atom . project . setPaths ( [ repo ] )
37
-
38
32
gitPackage = new GitPackage ( )
39
-
40
- await atom . packages . activatePackage ( 'git' )
33
+ await atom . packages . activatePackage ( 'github' )
41
34
} )
42
35
43
36
afterEach ( ( ) => {
44
37
gitPackage . deactivate ( )
45
38
} )
46
39
40
+ ffit ( 'updates the view model of the FileListComponent panel item when the active pane item changes to a different project directory' , async ( ) => {
41
+ const repoPath1 = copyRepository ( 'test-repo' )
42
+ const repoPath2 = copyRepository ( 'dummy-atom' )
43
+ atom . project . setPaths ( [ repoPath1 , repoPath2 ] )
44
+
45
+ await atom . workspace . open ( path . join ( repoPath1 , 'README.md' ) )
46
+ await gitPackage . openChangesPanel ( )
47
+ expect ( await gitPackage . fileListComponent . getViewModel ( ) . getGitStore ( ) . getWorkingDirectory ( ) ) . toBe ( repoPath1 + '/' )
48
+
49
+ await atom . workspace . open ( path . join ( repoPath2 , 'src' , 'config.coffee' ) )
50
+ expect ( await gitPackage . fileListComponent . getViewModel ( ) . getGitStore ( ) . getWorkingDirectory ( ) ) . toBe ( repoPath2 + '/' )
51
+ } )
52
+
47
53
xit ( 'closes open diffs of files that were committed' , async ( ) => {
54
+ jasmine . useRealClock ( )
55
+
56
+ repo = copyRepository ( )
57
+ atom . project . setPaths ( [ repo ] )
58
+
48
59
fs . writeFileSync ( path . join ( repo , 'README.md' ) , 'hey diddle diddle' )
49
60
50
61
await gitPackage . update ( )
0 commit comments