Commit 83310369 authored by Phil Hughes's avatar Phil Hughes

Fixed some specs

CHANGELOG item
parent 2b945741
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
IssuableForm.prototype.wipRegex = /^\s*(\[WIP\]\s*|WIP:\s*|WIP\s+)+\s*/i; IssuableForm.prototype.wipRegex = /^\s*(\[WIP\]\s*|WIP:\s*|WIP\s+)+\s*/i;
function IssuableForm(form) { function IssuableForm(form) {
var $issuableDueDate; var $issuableDueDate, calendar;
this.form = form; this.form = form;
this.toggleWip = bind(this.toggleWip, this); this.toggleWip = bind(this.toggleWip, this);
this.renderWipExplanation = bind(this.renderWipExplanation, this); this.renderWipExplanation = bind(this.renderWipExplanation, this);
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
this.initMoveDropdown(); this.initMoveDropdown();
$issuableDueDate = $('#issuable-due-date'); $issuableDueDate = $('#issuable-due-date');
if ($issuableDueDate.length) { if ($issuableDueDate.length) {
var calendar = new Pikaday({ calendar = new Pikaday({
field: $issuableDueDate.get(0), field: $issuableDueDate.get(0),
theme: 'gitlab-theme', theme: 'gitlab-theme',
format: 'yyyy-mm-dd', format: 'yyyy-mm-dd',
......
...@@ -21,12 +21,12 @@ ...@@ -21,12 +21,12 @@
theme: 'gitlab-theme', theme: 'gitlab-theme',
format: 'yyyy-mm-dd', format: 'yyyy-mm-dd',
minDate: new Date(), minDate: new Date(),
onSelect: (dateText) => { onSelect(dateText) {
$input.val(dateFormat(new Date(dateText), 'yyyy-mm-dd')); $input.val(dateFormat(new Date(dateText), 'yyyy-mm-dd'));
$input.trigger('change'); $input.trigger('change');
toggleClearInput.call(this); toggleClearInput.call($input);
}, },
}); });
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
.pika-single.gitlab-theme { .pika-single.gitlab-theme {
.pika-label { .pika-label {
color: $gl-gray; color: $gl-text-color-secondary;
font-size: 14px; font-size: 14px;
font-weight: normal; font-weight: normal;
} }
......
---
title: Replaced jQuery UI datepicker
merge_request:
author:
...@@ -241,7 +241,7 @@ describe 'Issue Boards', feature: true, js: true do ...@@ -241,7 +241,7 @@ describe 'Issue Boards', feature: true, js: true do
page.within('.due_date') do page.within('.due_date') do
click_link 'Edit' click_link 'Edit'
click_link Date.today.day click_button Date.today.day
wait_for_vue_resource wait_for_vue_resource
......
...@@ -78,8 +78,8 @@ describe 'Issues', feature: true do ...@@ -78,8 +78,8 @@ describe 'Issues', feature: true do
fill_in 'issue_description', with: 'bug description' fill_in 'issue_description', with: 'bug description'
find('#issuable-due-date').click find('#issuable-due-date').click
page.within '.ui-datepicker' do page.within '.pika-single' do
click_link date.day click_button date.day
end end
expect(find('#issuable-due-date').value).to eq date.to_s expect(find('#issuable-due-date').value).to eq date.to_s
...@@ -110,8 +110,8 @@ describe 'Issues', feature: true do ...@@ -110,8 +110,8 @@ describe 'Issues', feature: true do
fill_in 'issue_description', with: 'bug description' fill_in 'issue_description', with: 'bug description'
find('#issuable-due-date').click find('#issuable-due-date').click
page.within '.ui-datepicker' do page.within '.pika-single' do
click_link date.day click_button date.day
end end
expect(find('#issuable-due-date').value).to eq date.to_s expect(find('#issuable-due-date').value).to eq date.to_s
...@@ -624,8 +624,8 @@ describe 'Issues', feature: true do ...@@ -624,8 +624,8 @@ describe 'Issues', feature: true do
page.within '.due_date' do page.within '.due_date' do
click_link 'Edit' click_link 'Edit'
page.within '.ui-datepicker-calendar' do page.within '.pika-single' do
click_link date.day click_button date.day
end end
wait_for_ajax wait_for_ajax
...@@ -636,10 +636,10 @@ describe 'Issues', feature: true do ...@@ -636,10 +636,10 @@ describe 'Issues', feature: true do
it 'removes due date from issue' do it 'removes due date from issue' do
page.within '.due_date' do page.within '.due_date' do
click_link 'Edit' date = Date.today.at_beginning_of_month + 2.days
page.within '.ui-datepicker-calendar' do page.within '.pika-single' do
first('.ui-state-default').click click_button date.day
end end
wait_for_ajax wait_for_ajax
......
...@@ -34,7 +34,7 @@ describe 'Profile > Personal Access Tokens', feature: true, js: true do ...@@ -34,7 +34,7 @@ describe 'Profile > Personal Access Tokens', feature: true, js: true do
# Set date to 1st of next month # Set date to 1st of next month
find_field("Expires at").trigger('focus') find_field("Expires at").trigger('focus')
find("a[title='Next']").click find(".pika-next").click
click_on "1" click_on "1"
# Scopes # Scopes
......
...@@ -14,32 +14,30 @@ feature 'Projects > Members > Master adds member with expiration date', feature: ...@@ -14,32 +14,30 @@ feature 'Projects > Members > Master adds member with expiration date', feature:
login_as(master) login_as(master)
end end
scenario 'expiration date is displayed in the members list', js: true do scenario 'expiration date is displayed in the members list' do
travel_to Time.zone.parse('2016-08-06 08:00') do date = 5.days.from_now
visit namespace_project_settings_members_path(project.namespace, project) visit namespace_project_project_members_path(project.namespace, project)
page.within '.users-project-form' do
select2(new_member.id, from: '#user_ids', multiple: true) page.within '.users-project-form' do
fill_in 'expires_at', with: '2016-08-10' select2(new_member.id, from: '#user_ids', multiple: true)
end fill_in 'expires_at', with: date.to_s(:medium)
find('.users-project-form').click
click_on 'Add to project' click_on 'Add to project'
end
page.within "#project_member_#{new_member.project_members.first.id}" do page.within "#project_member_#{new_member.project_members.first.id}" do
expect(page).to have_content('Expires in 4 days') expect(page).to have_content('Expires in 4 days')
end
end end
end end
scenario 'change expiration date' do scenario 'change expiration date' do
travel_to Time.zone.parse('2016-08-06 08:00') do date = 4.days.from_now
project.team.add_users([new_member.id], :developer, expires_at: '2016-09-06') project.team.add_users([new_member.id], :developer, expires_at: Date.today.to_s(:medium))
visit namespace_project_project_members_path(project.namespace, project) visit namespace_project_project_members_path(project.namespace, project)
page.within "#project_member_#{new_member.project_members.first.id}" do page.within "#project_member_#{new_member.project_members.first.id}" do
find('.js-access-expiration-date').set '2016-08-09' find('.js-access-expiration-date').set date.to_s(:medium)
wait_for_ajax wait_for_ajax
expect(page).to have_content('Expires in 3 days') expect(page).to have_content('Expires in 3 days')
end
end end
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment