diff --git a/README.md b/README.md index 5f8e40a..067643d 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ ## Features -### It truncates long long long long...long long strings in the middle! +### It truncates long long long long…long long strings in the middle! ## Requirements diff --git a/src/__tests__/__image_snapshots__/truncate-string-browser-js-truncate-string-should-not-truncate-the-string-1-snap.png b/src/__tests__/__image_snapshots__/truncate-string-browser-js-truncate-string-should-not-truncate-the-string-1-snap.png index 90c44c0..b7bf74e 100644 Binary files a/src/__tests__/__image_snapshots__/truncate-string-browser-js-truncate-string-should-not-truncate-the-string-1-snap.png and b/src/__tests__/__image_snapshots__/truncate-string-browser-js-truncate-string-should-not-truncate-the-string-1-snap.png differ diff --git a/src/__tests__/__image_snapshots__/truncate-string-browser-js-truncate-string-should-render-a-truncated-string-1-snap.png b/src/__tests__/__image_snapshots__/truncate-string-browser-js-truncate-string-should-render-a-truncated-string-1-snap.png index 909c925..1dac81f 100644 Binary files a/src/__tests__/__image_snapshots__/truncate-string-browser-js-truncate-string-should-render-a-truncated-string-1-snap.png and b/src/__tests__/__image_snapshots__/truncate-string-browser-js-truncate-string-should-render-a-truncated-string-1-snap.png differ diff --git a/src/__tests__/__image_snapshots__/truncate-string-browser-js-truncate-string-should-work-with-resize-1-snap.png b/src/__tests__/__image_snapshots__/truncate-string-browser-js-truncate-string-should-work-with-resize-1-snap.png index 4acbc18..4884479 100644 Binary files a/src/__tests__/__image_snapshots__/truncate-string-browser-js-truncate-string-should-work-with-resize-1-snap.png and b/src/__tests__/__image_snapshots__/truncate-string-browser-js-truncate-string-should-work-with-resize-1-snap.png differ diff --git a/src/__tests__/__image_snapshots__/truncate-string-browser-js-truncate-string-should-work-with-update-1-snap.png b/src/__tests__/__image_snapshots__/truncate-string-browser-js-truncate-string-should-work-with-update-1-snap.png index 0e75dfa..4cf7d1c 100644 Binary files a/src/__tests__/__image_snapshots__/truncate-string-browser-js-truncate-string-should-work-with-update-1-snap.png and b/src/__tests__/__image_snapshots__/truncate-string-browser-js-truncate-string-should-work-with-update-1-snap.png differ diff --git a/src/__tests__/truncateString.browser.js b/src/__tests__/truncateString.browser.js index deda509..9339cff 100644 --- a/src/__tests__/truncateString.browser.js +++ b/src/__tests__/truncateString.browser.js @@ -23,7 +23,7 @@ describe('TruncateString', () => { expect(screenshot).toMatchImageSnapshot() } - await expect(page).toMatch('test long l...long string') + await expect(page).toMatch('test long lon\u2026g long string') }) test('should not truncate the string', async () => { @@ -48,7 +48,7 @@ describe('TruncateString', () => { await resizeWindow(100, 100) await page.waitFor(10) - await expect(page).toMatch('test...ring') + await expect(page).toMatch('test s\u2026string') if (!isCI) { const screenshot = await page.screenshot() @@ -76,7 +76,7 @@ describe('TruncateString', () => { await page.waitFor(200) - await expect(page).toMatch('test qui...t string') + await expect(page).toMatch('test quite\u2026ent string') if (!isCI) { const screenshot = await page.screenshot() diff --git a/src/__tests__/truncateString.test.js b/src/__tests__/truncateString.test.js index f0d38eb..e205054 100644 --- a/src/__tests__/truncateString.test.js +++ b/src/__tests__/truncateString.test.js @@ -10,10 +10,10 @@ describe('truncateText Unit', () => { component: 20 }, text: 'my string ends here', - ellipsisString: '...' + ellipsisString: '\u2026' } - expect(truncateString(parameters)).toEqual('my ...ere') + expect(truncateString(parameters)).toEqual('my st\u2026 here') }) it('should not truncate ', () => { @@ -24,7 +24,7 @@ describe('truncateText Unit', () => { component: 40 }, text: 'my string ends here', - ellipsisString: '...' + ellipsisString: '\u2026' } expect(truncateString(parameters)).toEqual('my string ends here') diff --git a/src/truncateString.js b/src/truncateString.js index b5afa86..2d214e8 100644 --- a/src/truncateString.js +++ b/src/truncateString.js @@ -37,7 +37,7 @@ class TruncateString extends PureComponent { } static defaultProps = { - ellipsisString: '...', + ellipsisString: '\u2026', text: '', truncateAt: 50 }