- Notifications
You must be signed in to change notification settings - Fork12
Interactions updates : custom label on Dropdown, closeHandler on Notification, clickHandler on Tile#4
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Interactions updates : custom label on Dropdown, closeHandler on Notification, clickHandler on Tile#4
Changes fromall commits
Commits
Show all changes
10 commits Select commitHold shift + click to select a range
ab514b4
prepare script
bb4bfcc
dropdown label
3081e63
Dropdown label from defaultText prop and update stories
d441621
update Dropdown test
72af2d8
closeHandler inline notification
720aef1
Clickable tile with onClick handler
ad0623f
modal onConfirmationHandler
1cf8b20
modal handlers for all buttons
7d92dee
copy button effective on code snippet
07bc5da
add tests for copy button
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
51 changes: 47 additions & 4 deletionscomponents/CaCodeSnippet/CaCodeSnippet.spec.js
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 |
---|---|---|
@@ -1,14 +1,57 @@ | ||
import { shallow } from 'vue-test-utils'; | ||
import CaCodeSnippet from './CaCodeSnippet.vue'; | ||
jest.useFakeTimers(); | ||
describe('CaCodeSnippet', () => { | ||
let wrapper; | ||
beforeEach(() => { | ||
wrapper = shallow(CaCodeSnippet); | ||
}); | ||
test('is a Vue instance', () => { | ||
expect(wrapper.isVueInstance()).toBeTruthy(); | ||
}); | ||
test('Mathes snapshot', () => { | ||
expect(wrapper.html()).toMatchSnapshot(); | ||
}); | ||
describe('when clicked on copy button', () => { | ||
beforeEach(() => { | ||
document.createRange = () => ({ | ||
selectNode: () => {}, | ||
}); | ||
window.getSelection = () => ({ | ||
addRange: () => {}, | ||
removeAllRanges: () => {}, | ||
}); | ||
}); | ||
describe('if copy succeeds', () => { | ||
beforeEach(() => { | ||
document.execCommand = jest.fn(() => true); | ||
wrapper.find('button').trigger('click'); | ||
}); | ||
it('should call the copy api', () => { | ||
expect(document.execCommand).toHaveBeenCalledWith('copy'); | ||
}); | ||
it('should show the feedback', () => { | ||
expect(wrapper.vm.$data.showFeedback).toBe(true); | ||
}); | ||
describe('after 2 seconds', () => { | ||
beforeEach(() => { | ||
jest.advanceTimersByTime(2000); | ||
}); | ||
it('should hide the feedback', () => { | ||
expect(wrapper.vm.$data.showFeedback).toBe(false); | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); |
41 changes: 37 additions & 4 deletionscomponents/CaCodeSnippet/CaCodeSnippet.vue
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
2 changes: 1 addition & 1 deletioncomponents/CaCodeSnippet/__snapshots__/CaCodeSnippet.spec.js.snap
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
11 changes: 9 additions & 2 deletionscomponents/CaDropdown/CaDropdown.spec.js
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
6 changes: 5 additions & 1 deletioncomponents/CaDropdown/CaDropdown.vue
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
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
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.