-
Notifications
You must be signed in to change notification settings - Fork 26
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
feat: input-date: Disclose when date was reverted to previous #5164
Merged
Merged
Changes from 6 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
309b2ab
feat: Date input: Disclose when data was reverted to previous
margaree 89b57bc
add vdiff tests, fix lint
margaree ba0cb79
add lang terms
margaree 7db278d
fix click behaviour
margaree 521b16d
code review feedback: use separate concatenated lang terms, get the l…
margaree d9ae386
code review feedback: use one tooltip in _getRevertTooltip
margaree 1476740
design feedback: include revert info in error tooltip if applicable
margaree fde7057
Updating vdiff goldens (#5165)
github-actions[bot] 1974bbd
lang terms: concatenate in lang terms rather than in code
margaree 47c691c
Updating vdiff goldens (#5178)
github-actions[bot] d2af075
fix accidental lang term changes
margaree 0ed12b7
Merge branch 'input-date-identify-revert' of github.com:BrightspaceUI…
margaree f292c30
add a viewport width to vdiffs
margaree da33381
increase timeout on flaky test
margaree 52b1342
try drastically increasing timeout
margaree ffe4986
fix vdiff flake?
margaree 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 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import '../input-date.js'; | ||
import { clickElem, expect, fixture, focusElem, html, nextFrame, oneEvent, sendKeys, sendKeysElem } from '@brightspace-ui/testing'; | ||
import { aTimeout, clickElem, expect, fixture, focusElem, html, nextFrame, oneEvent, sendKeys, sendKeysElem } from '@brightspace-ui/testing'; | ||
import { reset, useFakeTimers } from 'sinon'; | ||
import { ifDefined } from 'lit/directives/if-defined.js'; | ||
import { inlineHelpFixtures } from './input-shared-content.js'; | ||
|
@@ -351,6 +351,68 @@ describe('d2l-input-date', () => { | |
await sendKeysElem(elem, 'press', 'Enter'); | ||
await expect(elem).to.be.golden(); | ||
}); | ||
|
||
it('click then click away', async() => { | ||
await clickElem(elem); | ||
await clickElem(document.body); | ||
await expect(elem).to.be.golden(); | ||
}); | ||
|
||
it('open then close', async() => { | ||
await sendKeysElem(elem, 'press', 'Enter'); | ||
sendKeys('press', 'Escape'); | ||
await oneEvent(elem, 'd2l-tooltip-show'); | ||
await expect(elem).to.be.golden(); | ||
}); | ||
}); | ||
|
||
describe('required min-max revert', () => { | ||
|
||
it('delete text input then blur', async() => { | ||
margaree marked this conversation as resolved.
Show resolved
Hide resolved
|
||
const elem = await fixture(create({ label: 'Date', labelHidden: false, required: true, value: '2012-01-01', maxValue: '2018-02-27', minValue: '2018-02-13' })); | ||
await focusElem(elem); | ||
await sendKeysElem(elem, 'press', 'Tab'); | ||
|
||
await focusElem(elem); | ||
await sendKeysElem(elem, 'press', 'Backspace'); | ||
await sendKeys('press', 'Tab'); | ||
await expect(elem).to.be.golden(); | ||
}); | ||
|
||
}); | ||
|
||
describe('required revert', () => { | ||
|
||
let elem; | ||
beforeEach(async() => { | ||
elem = await fixture(create({ label: 'Date', labelHidden: false, required: true, value: '2020-01-01' })); | ||
}); | ||
|
||
it('delete text input then blur', async() => { | ||
await focusElem(elem); | ||
await sendKeysElem(elem, 'press', 'Backspace'); | ||
await sendKeys('press', 'Tab'); | ||
await expect(elem).to.be.golden(); | ||
}); | ||
|
||
it('delete text input then blur then re-focus', async() => { | ||
await focusElem(elem); | ||
await sendKeysElem(elem, 'press', 'Backspace'); | ||
await sendKeys('press', 'Tab'); | ||
await focusElem(elem); | ||
await aTimeout(100); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since the blur instructions and refocus instructions now use the same tooltip, we can no longer wait for the |
||
await expect(elem).to.be.golden(); | ||
}); | ||
|
||
it('delete text input then blur then re-focus then blur', async() => { | ||
await focusElem(elem); | ||
await sendKeysElem(elem, 'press', 'Backspace'); | ||
await sendKeys('press', 'Tab'); | ||
await focusElem(elem); | ||
await sendKeys('press', 'Tab'); | ||
await aTimeout(100); | ||
await expect(elem).to.be.golden(); | ||
}); | ||
}); | ||
}); | ||
|
||
|
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
This uses
this._namespace
for the lang terms which had come up as being bad practice since it makes searching for lang terms more difficult.Since I was adding more lang term usage I thought I'd clean this up, but let me know if I shouldn't actually do this or if it's too much noise.