import configurePlugins from '../src/util/configurePlugins'

test('setting a plugin to false removes it', () => {
  const plugins = {
    fontSize: (options) => {
      return {
        plugin: 'fontSize',
        options,
      }
    },
    display: (options) => {
      return {
        plugin: 'display',
        options,
      }
    },
    backgroundPosition: (options) => {
      return {
        plugin: 'backgroundPosition',
        options,
      }
    },
  }

  const configuredPlugins = configurePlugins(plugins, {
    fontSize: {},
    display: false,
    backgroundPosition: {},
  })

  expect(configuredPlugins).toEqual([
    { plugin: 'fontSize', options: {} },
    { plugin: 'backgroundPosition', options: {} },
  ])
})

@@ -728,8 +728,968 @@
   %5D)%0A%7D)%0A
+%0Atest('setting a plugin to an object configures that plugin', () =%3E %7B%0A  const plugins = %7B%0A    fontSize: (options) =%3E %7B%0A      return %7B%0A        plugin: 'fontSize',%0A        options,%0A      %7D%0A    %7D,%0A    display: (options) =%3E %7B%0A      return %7B%0A        plugin: 'display',%0A        options,%0A      %7D%0A    %7D,%0A    backgroundPosition: (options) =%3E %7B%0A      return %7B%0A        plugin: 'backgroundPosition',%0A        options,%0A      %7D%0A    %7D,%0A  %7D%0A%0A  const configuredPlugins = configurePlugins(plugins, %7B%0A    fontSize: %7B variants: %5B'responsive', 'hover'%5D, values: %7B '12': '12px', '14': '14px', '16': '16px', %7D %7D,%0A    display: %7B variants: %5B'responsive'%5D %7D,%0A    backgroundPosition: %7B%7D,%0A  %7D)%0A%0A  expect(configuredPlugins).toEqual(%5B%0A    %7B plugin: 'fontSize', options: %7B variants: %5B'responsive', 'hover'%5D, values: %7B '12': '12px', '14': '14px', '16': '16px', %7D %7D %7D,%0A    %7B plugin: 'display', options: %7B variants: %5B'responsive'%5D %7D %7D,%0A    %7B plugin: 'backgroundPosition', options: %7B%7D %7D,%0A  %5D)%0A%7D)%0A

Test overriding a core plugin's config