Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('cmsOperations.create()', function(done) {
// stub
var s = sinon.sandbox.create();
s.stub(abeExtend.hooks.instance, 'trigger', function (str, obj, body, json) {
return str, obj;
}.bind(this));
s.stub(coreUtils.slug, 'clean', function (p) { return p; }.bind(this));
s.stub(Manager.instance, 'postExist', function (p) { return false; }.bind(this));
s.stub(cmsData.metas, 'create', function (json, template, postUrl) { return json; }.bind(this));
s.stub(cmsTemplates.template, 'getTemplate', function () { return this.fixture.htmlArticle; }.bind(this));
s.stub(cmsData.values, 'removeDuplicate', function (templateText, json) { return json; }.bind(this));
s.stub(cmsOperations.post, 'draft', function () {
return Promise.resolve({json: JSON.parse(JSON.stringify(this.fixture.jsonArticle))})
}.bind(this));
cmsOperations.create('article', '/article-2.html', JSON.parse(JSON.stringify(this.fixture.jsonArticle)))
.then(function(resSave) {
var json = path.join(Manager.instance.pathData, resSave.abe_meta.latest.abeUrl.replace('.html', '.json'))
describe('linodes/linode/layouts/ResizePage', () => {
const sandbox = sinon.sandbox.create();
const dispatch = sandbox.spy();
afterEach(() => {
dispatch.reset();
sandbox.restore();
});
it('resize the linode', async () => {
const page = mount(
);
test('markdown/Markdown: before()', t => {
sand = sinon.sandbox.create();
t.end();
});
function setUpMocks() {
sinon.sandbox.restore();
sandbox = sinon.sandbox.create();
sandbox.stub(utils, 'getOrigin').callsFake(() => getMocks()['originAddress']);
sandbox.stub(utils, 'deepAccess').callsFake(() => getMocks()['windowLocationAddress']);
sandbox.stub(utils, 'getParameterByName').callsFake((arg) => {
switch (arg) {
case CATEGORY_NAME_QUERY_PARAM:
return CATEGORY_VALUE;
case NQ_NAME_QUERY_PARAM:
return NQ_VALUE;
}
});
}
beforeEach(function () {
sandbox = sinon.sandbox.create();
searchRequestManagerStub = testUtils.stubPublicApi(sandbox, SearchRequestManager);
searchResponseManagerStub = testUtils.stubPublicApi(sandbox, SearchResponseManager);
});
beforeEach(() => sandbox = sinon.sandbox.create());
afterEach(() => sandbox.restore());
beforeEach(() => {
sandbox = sinon.sandbox.create();
broadcastReporterMock = sandbox.stub(broadcastReporter, 'default');
captureTTY();
});
beforeEach(function() {
global.sandbox = sinon.sandbox.create();
});
describe('linodes/volumes/components/VolumesList', () => {
const sandbox = sinon.sandbox.create();
afterEach(() => {
sandbox.restore();
});
const dispatch = sandbox.spy();
it.skip('renders a table', () => {
const wrapper = shallow(
);
beforeEach(function () {
sandbox = sinon.sandbox.create();
});