mirror of https://github.com/artf/grapesjs.git
26 changed files with 1016 additions and 876 deletions
@ -0,0 +1,13 @@ |
|||||
|
# Configuration for probot-no-response - https://github.com/probot/no-response |
||||
|
|
||||
|
# Number of days of inactivity before an Issue is closed for lack of response |
||||
|
daysUntilClose: 10 |
||||
|
# Label requiring a response |
||||
|
responseRequiredLabel: more-information-needed |
||||
|
# Comment to post when closing an Issue for lack of response. Set to `false` to disable |
||||
|
closeComment: > |
||||
|
This issue has been automatically closed because there has been no response |
||||
|
to our request for more information from the original author. With only the |
||||
|
information that is currently in the issue, we don't have enough information |
||||
|
to take action. Please reach out if you have or find the answers we need so |
||||
|
that we can investigate further. |
||||
File diff suppressed because it is too large
File diff suppressed because one or more lines are too long
@ -0,0 +1,83 @@ |
|||||
|
const CommandAbstract = require('commands/view/CommandAbstract'); |
||||
|
const Editor = require('editor/model/Editor'); |
||||
|
|
||||
|
module.exports = { |
||||
|
run() { |
||||
|
describe('CommandAbstract', () => { |
||||
|
let editor, editorTriggerSpy, command; |
||||
|
|
||||
|
beforeEach(() => { |
||||
|
editor = new Editor(); |
||||
|
editorTriggerSpy = sinon.spy(editor, 'trigger'); |
||||
|
|
||||
|
command = new CommandAbstract(); |
||||
|
command.id = 'test'; |
||||
|
}); |
||||
|
|
||||
|
afterEach(() => { |
||||
|
command = null; |
||||
|
editorTriggerSpy = null; |
||||
|
editor = null; |
||||
|
}); |
||||
|
|
||||
|
it('callRun returns result when no "abort" option specified', () => { |
||||
|
const runStub = sinon.stub(command, 'run').returns('result'); |
||||
|
|
||||
|
const result = command.callRun(editor); |
||||
|
|
||||
|
expect(editorTriggerSpy.calledTwice).toEqual(true); |
||||
|
expect(editorTriggerSpy.getCall(0).args).toEqual([ |
||||
|
'run:test:before', |
||||
|
{} |
||||
|
]); |
||||
|
expect(editorTriggerSpy.getCall(1).args).toEqual([ |
||||
|
'run:test', |
||||
|
'result', |
||||
|
{} |
||||
|
]); |
||||
|
|
||||
|
expect(result).toEqual('result'); |
||||
|
expect(runStub.calledOnce).toEqual(true); |
||||
|
}); |
||||
|
|
||||
|
it('callRun returns undefined when "abort" option is specified', () => { |
||||
|
const runStub = sinon.stub(command, 'run').returns('result'); |
||||
|
|
||||
|
const result = command.callRun(editor, { abort: true }); |
||||
|
|
||||
|
expect(editorTriggerSpy.calledTwice).toEqual(true); |
||||
|
expect(editorTriggerSpy.getCall(0).args).toEqual([ |
||||
|
'run:test:before', |
||||
|
{ abort: true } |
||||
|
]); |
||||
|
expect(editorTriggerSpy.getCall(1).args).toEqual([ |
||||
|
'abort:test', |
||||
|
{ abort: true } |
||||
|
]); |
||||
|
|
||||
|
expect(result).toEqual(undefined); |
||||
|
expect(runStub.notCalled).toEqual(true); |
||||
|
}); |
||||
|
|
||||
|
it('callStop returns result', () => { |
||||
|
const stopStub = sinon.stub(command, 'stop').returns('stopped'); |
||||
|
|
||||
|
const result = command.callStop(editor); |
||||
|
|
||||
|
expect(editorTriggerSpy.calledTwice).toEqual(true); |
||||
|
expect(editorTriggerSpy.getCall(0).args).toEqual([ |
||||
|
'stop:test:before', |
||||
|
{} |
||||
|
]); |
||||
|
expect(editorTriggerSpy.getCall(1).args).toEqual([ |
||||
|
'stop:test', |
||||
|
'stopped', |
||||
|
{} |
||||
|
]); |
||||
|
|
||||
|
expect(result).toEqual('stopped'); |
||||
|
expect(stopStub.calledOnce).toEqual(true); |
||||
|
}); |
||||
|
}); |
||||
|
} |
||||
|
}; |
||||
Loading…
Reference in new issue