Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
4577f1f1
Commit
4577f1f1
authored
Dec 14, 2016
by
Clement Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add text utility spec
parent
3cb156dd
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
1 deletion
+25
-1
spec/javascripts/lib/utils/common_utils_spec.js.es6
spec/javascripts/lib/utils/common_utils_spec.js.es6
+0
-1
spec/javascripts/lib/utils/text_utility_spec.js.es6
spec/javascripts/lib/utils/text_utility_spec.js.es6
+25
-0
No files found.
spec/javascripts/lib/utils/common_utils_spec.js.es6
View file @
4577f1f1
...
@@ -52,6 +52,5 @@
...
@@ -52,6 +52,5 @@
expect(value).toBe(null);
expect(value).toBe(null);
});
});
});
});
});
});
})();
})();
spec/javascripts/lib/utils/text_utility_spec.js.es6
0 → 100644
View file @
4577f1f1
//= require lib/utils/text_utility
(() => {
describe('text_utility', () => {
describe('gl.text.getTextWidth', () => {
it('returns zero width when no text is passed', () => {
expect(gl.text.getTextWidth('')).toBe(0);
});
it('returns zero width when no text is passed and font is passed', () => {
expect(gl.text.getTextWidth('', '100px sans-serif')).toBe(0);
});
it('returns width when text is passed', () => {
expect(gl.text.getTextWidth('foo') > 0).toBe(true);
});
it('returns bigger width when font is larger', () => {
const largeFont = gl.text.getTextWidth('foo', '100px sans-serif');
const regular = gl.text.getTextWidth('foo', '10px sans-serif');
expect(largeFont > regular).toBe(true);
});
});
});
})();
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment