-
-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Nige White
committed
Nov 30, 2023
1 parent
3cac1db
commit dd5dc88
Showing
5 changed files
with
152 additions
and
46 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
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
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 |
---|---|---|
@@ -1,17 +1,40 @@ | ||
StartTest(t => { | ||
t.it('Checking if neo.mjs got started', async t => { | ||
if (!globalThis.Neo?.Main) { | ||
console.log('Starting the neo.mjs workers setup'); | ||
|
||
await import('../../../../src/MicroLoader.mjs'); | ||
} | ||
|
||
setTimeout(() => { | ||
Neo.worker.App.createNeoInstance({ | ||
ntype : 'button', | ||
iconCls: 'fa fa-home', | ||
text : 'Hello Siesta' | ||
}) | ||
}, 300) | ||
let button; | ||
|
||
t.beforeEach(async t => { | ||
// Causes errors | ||
// button && await Neo.worker.App.destroyNeoInstance(button); | ||
}); | ||
|
||
t.it('Sanity', async t => { | ||
button = await Neo.worker.App.createNeoInstance({ | ||
ntype : 'button', | ||
iconCls: 'fa fa-home', | ||
text : 'Hello Siesta' | ||
}); | ||
}); | ||
|
||
t.it('Should show isLoading UI', async t => { | ||
button = await Neo.worker.App.createNeoInstance({ | ||
ntype : 'button', | ||
iconCls : 'fa fa-home', | ||
text : 'Hello Siesta', | ||
isLoading : 'Loading...' | ||
}); | ||
|
||
// Spinner and text exist | ||
await t.waitForSelector('button .fa-spinner.fa-spin'); | ||
t.selectorExists('button .neo-loading-message:contains(Loading...)'); | ||
|
||
await Neo.worker.App.setConfigs({ id: button, isLoading : true }); | ||
|
||
// Just a spinner now, no text | ||
await t.waitForSelectorNotFound('button .neo-loading-message:contains(Loading...)'); | ||
t.selectorExists('button .neo-loading-message:contains()'); | ||
|
||
await Neo.worker.App.setConfigs({ id: button, isLoading : false }); | ||
|
||
// Not loading now, | ||
await t.waitForSelectorNotFound('button .neo-load-mask'); | ||
}); | ||
}); |
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 |
---|---|---|
@@ -1,35 +1,27 @@ | ||
StartTest(t => { | ||
t.it('Checking if neo.mjs got started', async t => { | ||
if (!globalThis.Neo?.Main) { | ||
console.log('Starting the neo.mjs workers setup'); | ||
t.it('Sanity', async t => { | ||
Neo.worker.App.createNeoInstance({ | ||
ntype : 'selectfield', | ||
labelPosition: 'inline', | ||
labelText : 'US States', | ||
labelWidth : 80, | ||
width : 300, | ||
|
||
await import('../../../../../src/MicroLoader.mjs'); | ||
} | ||
store : { | ||
autoLoad : true, | ||
keyProperty: 'abbreviation', | ||
url : '../../resources/examples/data/us_states.json', | ||
|
||
setTimeout(() => { | ||
Neo.worker.App.createNeoInstance({ | ||
ntype : 'selectfield', | ||
labelPosition: 'inline', | ||
labelText : 'US States', | ||
labelWidth : 80, | ||
width : 300, | ||
|
||
store : { | ||
autoLoad : true, | ||
keyProperty: 'abbreviation', | ||
url : '../../resources/examples/data/us_states.json', | ||
|
||
model: { | ||
fields: [{ | ||
name: 'abbreviation', | ||
type: 'string' | ||
}, { | ||
name: 'name', | ||
type: 'string' | ||
}] | ||
} | ||
model: { | ||
fields: [{ | ||
name: 'abbreviation', | ||
type: 'string' | ||
}, { | ||
name: 'name', | ||
type: 'string' | ||
}] | ||
} | ||
}) | ||
}, 1000) | ||
} | ||
}); | ||
}); | ||
}); |
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