2021-06-01 12:20:20 +00:00
|
|
|
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
|
|
|
|
|
2020-02-20 12:15:03 +00:00
|
|
|
require 'rails_helper'
|
|
|
|
|
|
|
|
RSpec.describe 'Manage > Calendars', type: :system do
|
|
|
|
|
|
|
|
context 'Date' do
|
2020-04-20 20:36:29 +00:00
|
|
|
let(:calendar_title) { "test calendar #{rand(999_999_999)}" }
|
2020-02-20 12:15:03 +00:00
|
|
|
|
|
|
|
it 'show festivity dates correctly far away from UTC', time_zone: 'America/Sao_Paulo' do
|
|
|
|
visit '/#manage/calendars'
|
|
|
|
|
|
|
|
click '.js-new'
|
|
|
|
|
|
|
|
modal_ready
|
|
|
|
|
|
|
|
within '.modal-dialog' do
|
2020-04-20 20:36:29 +00:00
|
|
|
fill_in 'name', with: calendar_title
|
2020-02-20 12:15:03 +00:00
|
|
|
|
|
|
|
click '.dropdown-toggle'
|
|
|
|
click '.dropdown-menu [data-value="America/Sao_Paulo"]'
|
|
|
|
|
|
|
|
find('.ical_feed select').select 'Brazil'
|
|
|
|
|
|
|
|
click '.js-submit'
|
|
|
|
end
|
|
|
|
|
|
|
|
modal_disappear
|
|
|
|
|
2020-04-20 20:36:29 +00:00
|
|
|
within :active_content do
|
|
|
|
within '.action', text: calendar_title do
|
|
|
|
find('.js-edit').click
|
|
|
|
end
|
|
|
|
end
|
2020-02-20 12:15:03 +00:00
|
|
|
|
2020-04-20 20:36:29 +00:00
|
|
|
wait(5).until_constant { find('.modal-dialog').style('height') }
|
2020-02-20 12:15:03 +00:00
|
|
|
|
|
|
|
within '.modal-dialog' do
|
2020-04-20 20:36:29 +00:00
|
|
|
row = first('.holiday_selector tr') do |elem|
|
|
|
|
elem.find('input.js-summary').value.starts_with?('Christmas Eve')
|
|
|
|
rescue
|
|
|
|
false
|
|
|
|
end
|
2020-02-20 12:15:03 +00:00
|
|
|
|
2020-04-20 20:36:29 +00:00
|
|
|
expect(row).to have_text('24').and have_text('12')
|
2020-02-20 12:15:03 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|