-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: add notebook diff editor scrolling test (#1238)
- Loading branch information
1 parent
b4ed00b
commit 9f548fd
Showing
2 changed files
with
231 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,210 @@ | ||
export const skip = process.platform === 'darwin' | ||
|
||
export const setup = async ({ Workspace, Explorer, Editor, DiffEditor }) => { | ||
const notebook1 = { | ||
cells: [ | ||
{ | ||
cell_type: 'code', | ||
metadata: {}, | ||
source: ['a'], | ||
}, | ||
{ | ||
cell_type: 'code', | ||
metadata: {}, | ||
source: ['a'], | ||
}, | ||
{ | ||
cell_type: 'code', | ||
metadata: {}, | ||
source: ['a'], | ||
}, | ||
{ | ||
cell_type: 'code', | ||
metadata: {}, | ||
source: ['a'], | ||
}, | ||
{ | ||
cell_type: 'code', | ||
metadata: {}, | ||
source: ['a'], | ||
}, | ||
{ | ||
cell_type: 'code', | ||
metadata: {}, | ||
source: ['a'], | ||
}, | ||
{ | ||
cell_type: 'code', | ||
metadata: {}, | ||
source: ['a'], | ||
}, | ||
{ | ||
cell_type: 'code', | ||
metadata: {}, | ||
source: ['a'], | ||
}, | ||
{ | ||
cell_type: 'code', | ||
metadata: {}, | ||
source: ['a'], | ||
}, | ||
{ | ||
cell_type: 'code', | ||
metadata: {}, | ||
source: ['a'], | ||
}, | ||
{ | ||
cell_type: 'code', | ||
metadata: {}, | ||
source: ['a'], | ||
}, | ||
{ | ||
cell_type: 'code', | ||
metadata: {}, | ||
source: ['a'], | ||
}, | ||
{ | ||
cell_type: 'code', | ||
metadata: {}, | ||
source: ['a'], | ||
}, | ||
{ | ||
cell_type: 'code', | ||
metadata: {}, | ||
source: ['a'], | ||
}, | ||
{ | ||
cell_type: 'code', | ||
metadata: {}, | ||
source: ['a'], | ||
}, | ||
{ | ||
cell_type: 'code', | ||
metadata: {}, | ||
source: ['a'], | ||
}, | ||
], | ||
metadata: { | ||
language_info: { | ||
name: 'python', | ||
}, | ||
}, | ||
nbformat: 4, | ||
nbformat_minor: 2, | ||
} | ||
const notebook2 = { | ||
cells: [ | ||
{ | ||
cell_type: 'code', | ||
metadata: {}, | ||
source: ['aa'], | ||
}, | ||
{ | ||
cell_type: 'code', | ||
metadata: {}, | ||
source: ['bb'], | ||
}, | ||
{ | ||
cell_type: 'code', | ||
metadata: {}, | ||
source: ['aa'], | ||
}, | ||
{ | ||
cell_type: 'code', | ||
metadata: {}, | ||
source: ['bb'], | ||
}, | ||
{ | ||
cell_type: 'code', | ||
metadata: {}, | ||
source: ['aa'], | ||
}, | ||
{ | ||
cell_type: 'code', | ||
metadata: {}, | ||
source: ['bb'], | ||
}, | ||
{ | ||
cell_type: 'code', | ||
metadata: {}, | ||
source: ['aa'], | ||
}, | ||
{ | ||
cell_type: 'code', | ||
metadata: {}, | ||
source: ['bb'], | ||
}, | ||
{ | ||
cell_type: 'code', | ||
metadata: {}, | ||
source: ['aa'], | ||
}, | ||
{ | ||
cell_type: 'code', | ||
metadata: {}, | ||
source: ['bb'], | ||
}, | ||
{ | ||
cell_type: 'code', | ||
metadata: {}, | ||
source: ['aa'], | ||
}, | ||
{ | ||
cell_type: 'code', | ||
metadata: {}, | ||
source: ['bb'], | ||
}, | ||
{ | ||
cell_type: 'code', | ||
metadata: {}, | ||
source: ['aa'], | ||
}, | ||
{ | ||
cell_type: 'code', | ||
metadata: {}, | ||
source: ['bb'], | ||
}, | ||
{ | ||
cell_type: 'code', | ||
metadata: {}, | ||
source: ['aa'], | ||
}, | ||
{ | ||
cell_type: 'code', | ||
metadata: {}, | ||
source: ['bb'], | ||
}, | ||
], | ||
metadata: { | ||
language_info: { | ||
name: 'python', | ||
}, | ||
}, | ||
nbformat: 4, | ||
nbformat_minor: 2, | ||
} | ||
|
||
await Workspace.setFiles([ | ||
{ | ||
name: 'notebook-1.ipynb', | ||
content: JSON.stringify(notebook1, null, 2) + '\n', | ||
}, | ||
{ | ||
name: 'notebook-2.ipynb', | ||
content: JSON.stringify(notebook2, null, 2) + '\n', | ||
}, | ||
]) | ||
await Editor.closeAll() | ||
await Explorer.focus() | ||
await Explorer.shouldHaveItem('notebook-1.ipynb') | ||
await Explorer.shouldHaveItem('notebook-2.ipynb') | ||
await Editor.open('notebook-1.ipynb') | ||
await DiffEditor.open('notebook-1.ipynb', 'notebook-2.ipynb') | ||
await DiffEditor.shouldHaveOriginalEditor('a') | ||
await DiffEditor.shouldHaveModifiedEditor('aa') | ||
} | ||
|
||
export const run = async ({ DiffEditor }) => { | ||
await DiffEditor.scrollDown() | ||
await DiffEditor.scrollUp() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters