コード例 #1
0
test('modified string to avoid mce prefix', function() {
  const btn = {
    ...this.buttonOpts,
    canvas_icon_class: 'foo-class'
  }
  const config = ExternalToolsHelper.buttonConfig(btn)
  equal(config.icon, 'hack-to-avoid-mce-prefix foo-class')
  equal(config.image, null)
})
コード例 #2
0
test('defaults to image if no icon class', function() {
  const btn = {
    ...this.buttonOpts,
    icon_url: 'example.com'
  }
  const config = ExternalToolsHelper.buttonConfig(btn)
  equal(config.icon, null)
  equal(config.image, 'example.com')
})
コード例 #3
0
test('makes a config as expected', function() {
  const config = ExternalToolsHelper.buttonConfig(this.buttonOpts)
  equal(config.title, 'SomeName')
  equal(config.cmd, 'instructureExternalButton_SomeId')
  equal(config.classes, 'widget btn instructure_external_tool_button')
})