Skip to content

Commit b6e5ccb

Browse files
committed
Atom 1.60.0 changes
1 parent 94d5b7c commit b6e5ccb

File tree

3 files changed

+14
-32
lines changed

3 files changed

+14
-32
lines changed

babel.config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"@babel/preset-env",
55
{
66
"targets": {
7-
"electron": "9"
7+
"electron": "11"
88
}
99
}
1010
]

spec/git-tabular-diff-spec.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,11 @@ describe(methodName, function() {
5656
GitTabularDiff.activate(null);
5757
GitTabularDiff.fileSelector = helper.makeFileSelector(repositoryPath, file);
5858
const id = await helper.openView(split);
59-
6059
expect(id.length).toBe(36);
61-
const workspaceElement = atom.views.getView(atom.workspace);
62-
expect(workspaceElement).toExist();
63-
const gitTabularDiffElement = workspaceElement.querySelector(`[id='${id}']`);
64-
expect(gitTabularDiffElement).toExist();
65-
expect(gitTabularDiffElement).toHaveClass('git-tabular-diff');
66-
6760
expect(GitTabularDiffView.pendingFileDiffs.size).toBe(0);
61+
62+
const view = atom.workspace.getActivePaneItem();
63+
expect(view).toBeInstanceOf(GitTabularDiffView);
6864
});
6965
});
7066

spec/git-tabular-diff-view-spec.js

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -43,24 +43,16 @@ describe('GitTabularDiffView.serialize()', function() {
4343
GitTabularDiff.activate(null);
4444
GitTabularDiff.fileSelector = helper.makeFileSelector(repositoryPath, exampleFile);
4545
const id = await helper.openView(split);
46-
4746
expect(id.length).toBe(36);
48-
const workspaceElement = atom.views.getView(atom.workspace);
49-
expect(workspaceElement).toExist();
50-
let gitTabularDiffElement = workspaceElement.querySelector(`[id='${id}']`);
51-
expect(gitTabularDiffElement).toExist();
52-
expect(gitTabularDiffElement).toHaveClass('git-tabular-diff');
53-
5447
expect(GitTabularDiffView.pendingFileDiffs.size).toBe(0);
5548

5649
let view = atom.workspace.getActivePaneItem();
5750
expect(view).toBeInstanceOf(GitTabularDiffView);
51+
5852
const serializedState = view.serialize();
5953

6054
view.destroy();
6155
view = null;
62-
gitTabularDiffElement = workspaceElement.querySelector(`[id='${id}']`);
63-
expect(gitTabularDiffElement).not.toExist();
6456

6557
view = GitTabularDiff.deserializeGitTabularDiffView(serializedState);
6658
expect(view).toBeInstanceOf(GitTabularDiffView);
@@ -96,29 +88,23 @@ describe('GitTabularDiffView.saveAs()', function() {
9688
GitTabularDiff.activate(null);
9789
GitTabularDiff.fileSelector = helper.makeFileSelector(repositoryPath, file);
9890
const id = await helper.openView(split);
99-
100-
const workspaceElement = atom.views.getView(atom.workspace);
101-
expect(workspaceElement).toExist();
102-
let gitTabularDiffElement = workspaceElement.querySelector(`[id='${id}']`);
103-
expect(gitTabularDiffElement).toExist();
104-
expect(gitTabularDiffElement).toHaveClass('git-tabular-diff');
105-
91+
expect(id.length).toBe(36);
10692
expect(GitTabularDiffView.pendingFileDiffs.size).toBe(0);
10793

94+
const view = atom.workspace.getActivePaneItem();
95+
expect(view).toBeInstanceOf(GitTabularDiffView);
96+
10897
// opening again should activate the existing view, not open another
10998
const id2 = await helper.openView(split);
11099
expect(id2).toBe(id);
111100
expect(GitTabularDiffView.pendingFileDiffs.size).toBe(0);
112101

113-
let view = atom.workspace.getActivePaneItem();
114-
expect(view).toBeInstanceOf(GitTabularDiffView);
115-
expect(view.getPath()).toBe(saveAsFile);
116-
await view.saveAs(saveAsPath);
102+
const view2 = atom.workspace.getActivePaneItem();
103+
expect(view2).toBe(view);
104+
expect(GitTabularDiffView.pendingFileDiffs.size).toBe(0);
117105

118-
view.destroy();
119-
view = null;
120-
gitTabularDiffElement = workspaceElement.querySelector(`[id='${id}']`);
121-
expect(gitTabularDiffElement).not.toExist();
106+
expect(view2.getPath()).toBe(saveAsFile);
107+
await view2.saveAs(saveAsPath);
122108

123109
const savedfileContents = await fs.readFile(saveAsPath, 'utf8');
124110
const goodSaveAsPath = path.join(repositoryPath, file);

0 commit comments

Comments
 (0)