<commit_before># This is a "Gold master" test. If you need to update these constants, you can do so
# by manually clicking through the kitchen sink form in the Chrome dev console and running:
#
#   copy(JSON.stringify($('[data-formrenderer]').data('form-renderer-instance').getValue()))
#
# ...which will copy the stringified JSON to your clipboard. You should then manually verify
# the output, and if you're satisfied, you can finally update the constant.

EXPECTED_BLANK_VALUES = '{"37":{"0":false,"1":false},"44":{"am_pm":"AM"},"46":"","48":{"country":"US"},"49":{"0":["",""],"1":["",""]}}'

EXPECTED_PRESENT_VALUES = '{"35":"foo","36":"bar","37":{"0":"on","1":false},"39":"Choice #2","40":"Choice #2","41":{"dollars":"12","cents":"99"},"42":"123","43":{"month":"12","day":"30","year":"2014"},"44":{"am_pm":"PM","hours":"6","minutes":"01","seconds":"30"},"45":"http://www.google.com","46":"","47":"<EMAIL>","48":{"country":"GB","street":"123 main st","state":null},"49":{"0":["hey",""],"1":["","nay"]},"50":{"lat":"40.7700118","lng":"-73.9800453"},"51":"510-123-4567"}'

describe '#getValue', ->
  before ->
    $('body').html('<div data-formrenderer />')
    @fr = new FormRenderer Fixtures.FormRendererOptions.KITCHEN_SINK()

  it 'renders ok', ->
    expect(@fr).to.be.ok

  it 'serializes the blank values', ->
    expect(JSON.stringify(@fr.getValue())).to.equal(EXPECTED_BLANK_VALUES)

  it 'serializes present values', ->
    $('.fr_response_field_text input').val('foo').trigger('input')
    $('.fr_response_field_paragraph textarea').val('bar').trigger('input')
    $('.fr_response_field_checkboxes input').first().click().trigger('change')
    $('.fr_response_field_radio input').last().click().trigger('change')
    $('.fr_response_field_dropdown select').val('Choice #2').trigger('change')
    $('.fr_response_field_price input').first().val('12').trigger('input')
    $('.fr_response_field_price input').last().val('99').trigger('input')<commit_msg>update gm test for new file input<commit_after># This is a "Gold master" test. If you need to update these constants, you can do so
# by manually clicking through the kitchen sink form in the Chrome dev console and running:
#
#   copy(JSON.stringify($('[data-formrenderer]').data('form-renderer-instance').getValue()))
#
# ...which will copy the stringified JSON to your clipboard. You should then manually verify
# the output, and if you're satisfied, you can finally update the constant.

EXPECTED_BLANK_VALUES = '{"37":{"0":false,"1":false},"44":{"am_pm":"AM"},"46":[],"48":{"country":"US"},"49":{"0":["",""],"1":["",""]}}'

EXPECTED_PRESENT_VALUES = '{"35":"foo","36":"bar","37":{"0":"on","1":false},"39":"Choice #2","40":"Choice #2","41":{"dollars":"12","cents":"99"},"42":"123","43":{"month":"12","day":"30","year":"2014"},"44":{"am_pm":"PM","hours":"6","minutes":"01","seconds":"30"},"45":"http://www.google.com","46":[],"47":"<EMAIL>","48":{"country":"GB","street":"123 main st","state":null},"49":{"0":["hey",""],"1":["","nay"]},"50":{"lat":"40.7700118","lng":"-73.9800453"},"51":"510-123-4567"}'

describe '#getValue', ->
  before ->
    $('body').html('<div data-formrenderer />')
    @fr = new FormRenderer Fixtures.FormRendererOptions.KITCHEN_SINK()

  it 'renders ok', ->
    expect(@fr).to.be.ok

  it 'serializes the blank values', ->
    expect(JSON.stringify(@fr.getValue())).to.equal(EXPECTED_BLANK_VALUES)

  it 'serializes present values', ->
    $('.fr_response_field_text input').val('foo').trigger('input')
    $('.fr_response_field_paragraph textarea').val('bar').trigger('input')
    $('.fr_response_field_checkboxes input').first().click().trigger('change')
    $('.fr_response_field_radio input').last().click().trigger('change')
    $('.fr_response_field_dropdown select').val('Choice #2').trigger('change')
    $('.fr_response_field_price input').first().val('12').trigger('input')
    $('.fr_response_field_price input').last().val('99').trigger('input')
{'fraction_non_alphanumeric': 0.2643037974683544, 'fraction_numerical': 0.05468354430379747, 'mean_word_length': 7.0141987829614605, 'pattern_counts': {'":': 90, '<': 7, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6249189', 'n_tokens_mistral': 1416, 'n_tokens_neox': 1265, 'n_words': 217}