<commit_before>PSD           = require '../'
path          = require 'path'
should        = require 'should'

describe "extracting info from a text layer", ->

  it "should extract leading value", (done) ->
    psdPath   = path.resolve(__dirname, "../", "examples/images/example-leading.psd")
    expected  = [ 24 ]

    PSD.open(psdPath)
    .then (psd) ->
      actual = psd.tree().descendants()[0].get('typeTool').leadings()
      should(actual).eql(expected)
      done()
    .catch done

  it "should generate line-height when .toCSS() is called", (done)->
    psdPath   = path.resolve(__dirname, "../", "examples/images/example-leading.psd")
    expected  = '''font-family: Helvetica, AdobeInvisFont, KozGoPr6N-Regular;
font-size: 12px;
line-height: 24px;
color: rgba(0, 0, 0, 255);
text-align: left;'''

    PSD.open(psdPath)
    .then (psd) ->
      actual = psd.tree().descendants()[0].get('typeTool').toCSS()
      should(actual).eql(expected)
      done()
    .catch done
<commit_msg>remove expected font-size in test code<commit_after>PSD           = require '../'
path          = require 'path'
should        = require 'should'

describe "extracting info from a text layer", ->

  it "should extract leading value", (done) ->
    psdPath   = path.resolve(__dirname, "../", "examples/images/example-leading.psd")
    expected  = [ 24 ]

    PSD.open(psdPath)
    .then (psd) ->
      actual = psd.tree().descendants()[0].get('typeTool').leadings()
      should(actual).eql(expected)
      done()
    .catch done

  it "should generate line-height when .toCSS() is called", (done)->
    psdPath   = path.resolve(__dirname, "../", "examples/images/example-leading.psd")
    expected  = '''font-family: Helvetica, AdobeInvisFont, KozGoPr6N-Regular;
line-height: 24px;
color: rgba(0, 0, 0, 255);
text-align: left;'''

    PSD.open(psdPath)
    .then (psd) ->
      actual = psd.tree().descendants()[0].get('typeTool').toCSS()
      should(actual).eql(expected)
      done()
    .catch done

{'fraction_non_alphanumeric': 0.16916916916916916, 'fraction_numerical': 0.014014014014014014, 'mean_word_length': 2.904296875, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '1326655', 'n_tokens_mistral': 706, 'n_tokens_neox': 657, 'n_words': 147}