-
-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: truncate tags, branches and versions in UI when they are super …
…long (#513)
- Loading branch information
Showing
6 changed files
with
56 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
require "pact_broker/string_refinements" | ||
|
||
module PactBroker | ||
describe StringRefinements do | ||
using StringRefinements | ||
|
||
describe "ellipsisize" do | ||
let(:very_long_string) do | ||
"This is a very long string. May be too long to be true. It should be truncated in the middle" | ||
end | ||
|
||
context "when using default value to truncate the string" do | ||
it "truncates the string in the middle to the default length" do | ||
expect(very_long_string.ellipsisize).to eq("This is a ...the middle") | ||
end | ||
end | ||
|
||
context "when using customised value to truncate the string" do | ||
it "truncates the string in the middle to the customised length" do | ||
expect(very_long_string.ellipsisize(edge_length: 15)).to eq("This is a very ...d in the middle") | ||
end | ||
end | ||
end | ||
end | ||
end |