Skip to content

Commit

Permalink
Add link to previous session table
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Apr 23, 2018
1 parent a4034a6 commit a4722b1
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 33 deletions.
2 changes: 1 addition & 1 deletion src/JBrowse/Browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ loadSessions: function() {

var path = app.getPath('userData') + "/sessions.json";
var obj = JSON.parse( fs.readFileSync( path, 'utf8' ) );
var table = dojo.create( 'table', { style: { overflow: 'hidden', width: '90%' } }, dojo.byId('previousSessions') );
var table = dojo.create( 'table', { id: 'previousSessionsTable', style: { overflow: 'hidden', width: '90%' } }, dojo.byId('previousSessions') );
var thisB = this;

if( ! obj.length ) {
Expand Down
63 changes: 31 additions & 32 deletions tests/electron_tests/spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,43 +5,42 @@ import path from 'path';


test.beforeEach(async t => {
t.context.app = new Application({
path: electronPath,
args: [path.join(__dirname, '../..')],
env: {SPECTRON: '1'},
requireName: 'electronRequire'
});

return t.context.app.start();
t.context.app = new Application({
path: electronPath,
args: [path.join(__dirname, '../..')],
env: {SPECTRON: '1'},
requireName: 'electronRequire'
});

await t.context.app.start();
});

test.afterEach.always(async t => {
return t.context.app.stop();
await t.context.app.stop();
});

test('shows window', async t => {
let app = t.context.app;
await app.client.waitUntilWindowLoaded();

const win = app.browserWindow;
t.is(await app.client.getWindowCount(), 1);
t.false(await win.isMinimized());
t.false(await win.isDevToolsOpened());
t.true(await win.isVisible());

const {width, height} = await win.getBounds();
t.true(width > 0);
t.true(height > 0);


var text = await app.client.getText("#welcome");
t.is(text.substr(0,12), "Your JBrowse");
await app.client.click("#newOpen");
await app.client.click("#openFile");
await app.client.click("#dijit_form_Button_1");
await app.restart()
await app.client.waitUntilWindowLoaded()
var text = await app.client.getText("#previousSessions");
t.true(t!=null);
const app = t.context.app;
await app.client.waitUntilWindowLoaded();

const win = app.browserWindow;
t.is(await app.client.getWindowCount(), 1);
t.false(await win.isMinimized());
t.false(await win.isDevToolsOpened());
t.true(await win.isVisible());

const {width, height} = await win.getBounds();
t.true(width > 0);
t.true(height > 0);

var text = await app.client.getText("#welcome");
t.is(text.substr(0,12), "Your JBrowse");
await app.client.click("#newOpen");
await app.client.click("#openFile");
await app.client.click("#dijit_form_Button_1");
await app.restart()
await app.client.waitUntilWindowLoaded()
text = await app.client.getText("#previousSessionsTable");
t.true(text != null);
});

0 comments on commit a4722b1

Please sign in to comment.