-
Notifications
You must be signed in to change notification settings - Fork 28
Increase coverage #3513
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
Merged
Merged
Increase coverage #3513
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
06b3a10
Increase coverage
9f0d6e4
Merge branch 'main' into increase-coverage
sroy3 2bfa836
Add more tests
e2ea7cf
Merge branch 'increase-coverage' of https://github.com/iterative/vsco…
34b7aae
Change label of test to match behaviour expected
0422023
Merge branch 'main' into increase-coverage
mattseddon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 was deleted.
Oops, something went wrong.
This file contains hidden or 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,41 @@ | ||
| import { changeOrderWithDraggedInfo, pushIf } from './array' | ||
|
|
||
| describe('array', () => { | ||
| describe('pushIf', () => { | ||
| it('should not push to array if condiction is not met', () => { | ||
| const currentArray = [1, 2, 3] | ||
| pushIf(currentArray, false, [4]) | ||
|
|
||
| expect(currentArray.length).toBe(3) | ||
| }) | ||
|
|
||
| it('should push to array if condiction is met', () => { | ||
| const currentArray = [1, 2, 3] | ||
| pushIf(currentArray, true, [4]) | ||
|
|
||
| expect(currentArray.length).toBe(4) | ||
| }) | ||
| }) | ||
|
|
||
| describe('changeOrderWithDraggedInfo', () => { | ||
| it('should return the same order if there are no draggedInfo', () => { | ||
| const currentOrder = ['1', '2', '3', '4'] | ||
|
|
||
| expect(changeOrderWithDraggedInfo(currentOrder, undefined)).toBe( | ||
| currentOrder | ||
| ) | ||
| }) | ||
|
|
||
| it('should return the order with the dragged item id moved to the end', () => { | ||
| const currentOrder = ['1', '2', '3', '4'] | ||
|
|
||
| expect( | ||
| changeOrderWithDraggedInfo(currentOrder, { | ||
| group: 'any', | ||
| itemId: '2', | ||
| itemIndex: '1' | ||
| }) | ||
| ).toStrictEqual(['1', '3', '4', '2']) | ||
| }) | ||
| }) | ||
| }) |
This file contains hidden or 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,11 @@ | ||
| import { createIDWithPrefixAndIndex } from './ids' | ||
|
|
||
| describe('ids', () => { | ||
| describe('createIDWithPrefixAndIndex', () => { | ||
| it('should create an id with a prefix and an index correctly', () => { | ||
| expect(createIDWithPrefixAndIndex('my-id', 42, 'this-isAPREFIX')).toBe( | ||
| 'this-isAPREFIXmy-id_42' | ||
| ) | ||
| }) | ||
| }) | ||
| }) |
This file contains hidden or 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,14 @@ | ||
| import { getThemeValue, ThemeProperty } from './styles' | ||
|
|
||
| describe('styles', () => { | ||
| it('should get the theme value for the requested property when calling getThemeValue', () => { | ||
| const styleValue = 'blue' | ||
|
|
||
| document.documentElement.style.setProperty( | ||
| ThemeProperty.ACCENT_COLOR, | ||
| styleValue | ||
| ) | ||
|
|
||
| expect(getThemeValue(ThemeProperty.ACCENT_COLOR)).toBe(styleValue) | ||
| }) | ||
| }) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correctly removes the
IconWrapperandIconWrapperscomponents from the coverage.