Skip to content

Use single ellipsis unicode character by default #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions src/__tests__/truncateString.browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand All @@ -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()
Expand Down Expand Up @@ -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()
Expand Down
6 changes: 3 additions & 3 deletions src/__tests__/truncateString.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ', () => {
Expand All @@ -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')
Expand Down
2 changes: 1 addition & 1 deletion src/truncateString.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class TruncateString extends PureComponent {
}

static defaultProps = {
ellipsisString: '...',
ellipsisString: '\u2026',
text: '',
truncateAt: 50
}
Expand Down