fs = require 'fs' path = require 'path' React = require ('react') ReactTestUtils = React.addons.TestUtils {FormItem, GeneratedForm, GeneratedFieldset} = require ('../../src/components/generated-form') fixtureModule = 'internal_packages/salesforce' Adapter = require path.join('../../', fixtureModule, 'lib/salesforce-schema-adapter.coffee') fpath = path.join(fixtureModule, 'spec/fixtures/opportunity-layouts.json') rawData = JSON.parse(fs.readFileSync(fpath, 'utf-8')) testData = Adapter.convertLayout("opportunity", rawData) describe "Form Builder", -> beforeEach -> for fieldset in testData.fieldsets for formItem in fieldset.formItems if formItem.type is "reference" formItem.type = React.createClass(render: ->
) @form = ReactTestUtils.renderIntoDocument(