Skip to content

Commit

Permalink
New file fix (#77)
Browse files Browse the repository at this point in the history
* Fix issue with new file

* Add test for file creation
  • Loading branch information
gjmooney authored Jul 29, 2024
1 parent 040976c commit df35a63
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion python/jupytergis_core/src/jgisplugin/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const activate = (
format: 'text',
size: undefined,
content:
'{\n\t"layers": {},\n\t"sources": {},\n\t"options": {"latitude": 0, "longitude": 0, "zoom": 0, "bearing": 0, "pitch": 0},\n\t"layerTree": []\n\t"terrain": {}\n}'
'{\n\t"layers": {},\n\t"sources": {},\n\t"options": {"latitude": 0, "longitude": 0, "zoom": 0, "bearing": 0, "pitch": 0},\n\t"layerTree": [],\n\t"terrain": {"source": "", "exaggeration": 0}\n}'
});

// Open the newly created file with the 'Editor'
Expand Down
24 changes: 24 additions & 0 deletions ui-tests/tests/new-file.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { expect, test } from '@jupyterlab/galata';

test.describe('#newFile', () => {
test.afterEach(async ({ page }) => {
await page.activity.closeAll();
});

test('New file should open with no errors', async ({ page }) => {
await page
.getByLabel('notebook content')
.getByText('New JGIS File')
.click();

const tab = page.getByLabel('notebook content');
const sources = page.getByText('Sources', { exact: true });
const layers = page.getByText('Layers');
const map = page.getByLabel('Map');

await expect(tab).toBeVisible();
await expect(sources).toBeVisible();
await expect(layers).toBeVisible();
await expect(map).toBeVisible();
});
});

0 comments on commit df35a63

Please sign in to comment.