1
0
mirror of synced 2025-12-08 06:38:00 +08:00
Files
eruda/test/snippets.js
2017-11-05 14:35:39 +08:00

53 lines
1.4 KiB
JavaScript

describe('snippets', function ()
{
var tool = eruda.get('snippets'),
$tool = $('.eruda-snippets');
describe('default', function ()
{
it('border all', function ()
{
expect($tool.find('.eruda-name').eq(0)).toContainText('Border All');
});
it('refresh page', function ()
{
expect($tool.find('.eruda-name').eq(1)).toContainText('Refresh Page');
});
it('search text', function ()
{
expect($tool.find('.eruda-name').eq(2)).toContainText('Search Text');
});
it('edit page', function ()
{
expect($tool.find('.eruda-name').eq(3)).toContainText('Edit Page');
});
});
describe('basic', function ()
{
it('clear', function ()
{
tool.clear();
expect($tool.find('.eruda-name')).toHaveLength(0);
});
it('add', function ()
{
tool.add('Test', function ()
{
console.log('eruda');
}, 'This is the description');
expect($tool.find('.eruda-name')).toContainText('Test');
expect($tool.find('.eruda-description')).toContainText('This is the description');
});
it('remove', function ()
{
tool.remove('Test');
expect($tool.find('.eruda-name')).toHaveLength(0);
});
});
});