import { assert } from 'chai';
import getPetitionResponseStatusText from 'helpers/getPetitionResponseStatusText';

describe('getPetitionsPageText', () => {
  it('returns the title for a pending response', () => {
    const actual = getPetitionResponseStatusText({
      pending: true,
      total: 100,
      required: 50,
      daysPending: 10
    });
    const expected = 'This petition reached its target goal of 50 votes and is awaiting response since **10** days ago.';

    assert.equal(actual, expected);
  });

  it('returns the title for an arrived response', () => {
    const actual = getPetitionResponseStatusText({
      pending: false,
      total: 100,
      required: 50,
      daysPending: 10,
      name: 'Jane Doe, Mayor'
    });
    const expected = 'This petition reached its target goal of 50 votes and has already been answered by Jane Doe, Mayor.';

    assert.equal(actual, expected);
  });
});

@@ -276,37 +276,38 @@
 ng: true,%0A      
-total
+amount
 : 100,%0A      req
@@ -552,32 +552,43 @@
 arrived response
+, with link
 ', () =%3E %7B%0A    c
@@ -665,13 +665,14 @@
     
-total
+amount
 : 10
@@ -747,32 +747,32 @@
  Mayor'%0A    %7D);%0A
-
     const expect
@@ -876,16 +876,64 @@
 , Mayor.
+%5Cn%5Cn%3Ca href=%22#response%22%3EView official reply%3C/a%3E.
 ';%0A%0A    

Fix getPetitionResponseStatusText helper test