Antonio-Maranhao commented on a change in pull request #1103: Customize style 
of the results list
URL: https://github.com/apache/couchdb-fauxton/pull/1103#discussion_r231738709
 
 

 ##########
 File path: app/addons/documents/__tests__/table-row.test.js
 ##########
 @@ -54,4 +56,34 @@ describe('Docs Table Row', () => {
     assert.equal(wrapper.find('td').at(5).text(), 
JSON.stringify(elem.content.vInt));
     assert.equal(wrapper.find('td').at(6).text().replace(/[\s]/g, ''), 
JSON.stringify(elem.content.vObject));
   });
+
+  it('shows full text values', () => {
+    const wrapper = shallow(<TableRow
+      onClick={sinon.stub()}
+      docChecked={sinon.stub()}
+      el={elem}
+      data={data}
+      index={0}
+      docIdentifier={elem.id}
+      isSelected={false}
+      textOverflow={Constants.INDEX_RESULTS_STYLE.TEXT_OVERFLOW_FULL}
+    />);
+
+    expect(wrapper.find('td.showall').exists()).toBe(true);
+  });
+
+  it('truncates text values', () => {
+    const wrapper = shallow(<TableRow
+      onClick={sinon.stub()}
+      docChecked={sinon.stub()}
+      el={elem}
+      data={data}
+      index={0}
+      docIdentifier={elem.id}
+      isSelected={false}
+      textOverflow={Constants.INDEX_RESULTS_STYLE.TEXT_OVERFLOW_TRUNCATED}
+    />);
+
+    expect(wrapper.find('td.showall').exists()).toBe(false);
 
 Review comment:
   No because `find()` will always return a Wrapper even when there is no 
match. You need to either call `exists()` or check if `length` is zero.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to