mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
✅ fix timezone errors in editor tests (#638)
This commit is contained in:
parent
35cf6c9829
commit
10653fbca6
1 changed files with 5 additions and 12 deletions
|
@ -88,7 +88,7 @@ describe('Acceptance: Editor', function() {
|
||||||
|
|
||||||
it('renders the editor correctly, PSM Publish Date and Save Button', function () {
|
it('renders the editor correctly, PSM Publish Date and Save Button', function () {
|
||||||
server.createList('post', 2);
|
server.createList('post', 2);
|
||||||
let plusTenMinPacific = moment().tz('Pacific/Kwajalein').add(10, 'minutes');
|
let futureTime = moment().tz('Etc/UTC').add(10, 'minutes');
|
||||||
|
|
||||||
// post id 1 is a draft, checking for draft behaviour now
|
// post id 1 is a draft, checking for draft behaviour now
|
||||||
visit('/editor/1');
|
visit('/editor/1');
|
||||||
|
@ -111,9 +111,9 @@ describe('Acceptance: Editor', function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
// should error, if the publish time is in the future
|
// should error, if the publish time is in the future
|
||||||
fillIn(testSelector('date-time-picker-time-input'), plusTenMinPacific.format('HH:mm'));
|
fillIn(testSelector('date-time-picker-time-input'), futureTime.format('HH:mm'));
|
||||||
triggerEvent(testSelector('date-time-picker-time-input'), 'blur');
|
triggerEvent(testSelector('date-time-picker-time-input'), 'blur');
|
||||||
datepickerSelect(testSelector('date-time-picker-datepicker'), plusTenMinPacific);
|
datepickerSelect(testSelector('date-time-picker-datepicker'), futureTime);
|
||||||
|
|
||||||
andThen(() => {
|
andThen(() => {
|
||||||
expect(find(testSelector('date-time-picker-error')).text().trim(), 'inline error response for future time')
|
expect(find(testSelector('date-time-picker-error')).text().trim(), 'inline error response for future time')
|
||||||
|
@ -245,16 +245,9 @@ describe('Acceptance: Editor', function() {
|
||||||
click(testSelector('publishmenu-cancel'));
|
click(testSelector('publishmenu-cancel'));
|
||||||
click(testSelector('publishmenu-trigger'));
|
click(testSelector('publishmenu-trigger'));
|
||||||
|
|
||||||
// draft menu should show
|
let newFutureTime = moment.tz('Pacific/Kwajalein').add(10, 'minutes');
|
||||||
andThen(() => {
|
|
||||||
expect(
|
|
||||||
find(testSelector('publishmenu-draft')),
|
|
||||||
'draft menu is shown after unpublished'
|
|
||||||
).to.exist;
|
|
||||||
});
|
|
||||||
|
|
||||||
click(testSelector('publishmenu-scheduled-option'));
|
click(testSelector('publishmenu-scheduled-option'));
|
||||||
datepickerSelect(`${testSelector('publishmenu-draft')} ${testSelector('date-time-picker-datepicker')}`, plusTenMinPacific);
|
datepickerSelect(`${testSelector('publishmenu-draft')} ${testSelector('date-time-picker-datepicker')}`, newFutureTime);
|
||||||
click(testSelector('publishmenu-save'));
|
click(testSelector('publishmenu-save'));
|
||||||
click(testSelector('publishmenu-cancel'));
|
click(testSelector('publishmenu-cancel'));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue