Initial commit: Add logistics and order_detail message types
Some checks failed
Lock Threads / action (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
Publish Chatwoot EE docker images / build (linux/amd64, ubuntu-latest) (push) Has been cancelled
Publish Chatwoot EE docker images / build (linux/arm64, ubuntu-22.04-arm) (push) Has been cancelled
Publish Chatwoot EE docker images / merge (push) Has been cancelled
Publish Chatwoot CE docker images / build (linux/amd64, ubuntu-latest) (push) Has been cancelled
Publish Chatwoot CE docker images / build (linux/arm64, ubuntu-22.04-arm) (push) Has been cancelled
Publish Chatwoot CE docker images / merge (push) Has been cancelled
Run Chatwoot CE spec / lint-backend (push) Has been cancelled
Run Chatwoot CE spec / lint-frontend (push) Has been cancelled
Run Chatwoot CE spec / frontend-tests (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (0, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (1, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (10, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (11, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (12, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (13, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (14, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (15, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (2, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (3, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (4, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (5, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (6, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (7, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (8, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (9, 16) (push) Has been cancelled
Run Linux nightly installer / nightly (push) Has been cancelled
Some checks failed
Lock Threads / action (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
Publish Chatwoot EE docker images / build (linux/amd64, ubuntu-latest) (push) Has been cancelled
Publish Chatwoot EE docker images / build (linux/arm64, ubuntu-22.04-arm) (push) Has been cancelled
Publish Chatwoot EE docker images / merge (push) Has been cancelled
Publish Chatwoot CE docker images / build (linux/amd64, ubuntu-latest) (push) Has been cancelled
Publish Chatwoot CE docker images / build (linux/arm64, ubuntu-22.04-arm) (push) Has been cancelled
Publish Chatwoot CE docker images / merge (push) Has been cancelled
Run Chatwoot CE spec / lint-backend (push) Has been cancelled
Run Chatwoot CE spec / lint-frontend (push) Has been cancelled
Run Chatwoot CE spec / frontend-tests (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (0, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (1, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (10, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (11, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (12, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (13, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (14, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (15, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (2, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (3, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (4, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (5, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (6, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (7, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (8, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (9, 16) (push) Has been cancelled
Run Linux nightly installer / nightly (push) Has been cancelled
- Add Logistics component with progress tracking - Add OrderDetail component for order information - Support data-driven steps and actions - Add blue color scale to widget SCSS - Fix node overflow and progress bar rendering issues - Add English translations for dashboard components Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
77
spec/presenters/reports/time_format_presenter_spec.rb
Normal file
77
spec/presenters/reports/time_format_presenter_spec.rb
Normal file
@@ -0,0 +1,77 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe Reports::TimeFormatPresenter do
|
||||
describe '#format' do
|
||||
context 'when formatting days' do
|
||||
it 'formats single day correctly' do
|
||||
expect(described_class.new(86_400).format).to eq '1 day'
|
||||
end
|
||||
|
||||
it 'formats multiple days correctly' do
|
||||
expect(described_class.new(172_800).format).to eq '2 days'
|
||||
end
|
||||
|
||||
it 'includes seconds with days correctly' do
|
||||
expect(described_class.new(86_401).format).to eq '1 day 1 second'
|
||||
end
|
||||
|
||||
it 'includes hours with days correctly' do
|
||||
expect(described_class.new(93_600).format).to eq '1 day 2 hours'
|
||||
end
|
||||
|
||||
it 'includes minutes with days correctly' do
|
||||
expect(described_class.new(86_461).format).to eq '1 day 1 minute'
|
||||
end
|
||||
end
|
||||
|
||||
context 'when formatting hours' do
|
||||
it 'formats single hour correctly' do
|
||||
expect(described_class.new(3600).format).to eq '1 hour'
|
||||
end
|
||||
|
||||
it 'formats multiple hours correctly' do
|
||||
expect(described_class.new(7200).format).to eq '2 hours'
|
||||
end
|
||||
|
||||
it 'includes seconds with hours correctly' do
|
||||
expect(described_class.new(3601).format).to eq '1 hour 1 second'
|
||||
end
|
||||
|
||||
it 'includes minutes with hours correctly' do
|
||||
expect(described_class.new(3660).format).to eq '1 hour 1 minute'
|
||||
end
|
||||
end
|
||||
|
||||
context 'when formatting minutes' do
|
||||
it 'formats single minute correctly' do
|
||||
expect(described_class.new(60).format).to eq '1 minute'
|
||||
end
|
||||
|
||||
it 'formats multiple minutes correctly' do
|
||||
expect(described_class.new(120).format).to eq '2 minutes'
|
||||
end
|
||||
|
||||
it 'includes seconds with minutes correctly' do
|
||||
expect(described_class.new(62).format).to eq '1 minute 2 seconds'
|
||||
end
|
||||
end
|
||||
|
||||
context 'when formatting seconds' do
|
||||
it 'formats multiple seconds correctly' do
|
||||
expect(described_class.new(56).format).to eq '56 seconds'
|
||||
end
|
||||
|
||||
it 'handles floating-point seconds by truncating to the nearest lower second' do
|
||||
expect(described_class.new(55.2).format).to eq '55 seconds'
|
||||
end
|
||||
|
||||
it 'formats single second correctly' do
|
||||
expect(described_class.new(1).format).to eq '1 second'
|
||||
end
|
||||
|
||||
it 'formats nil second correctly' do
|
||||
expect(described_class.new.format).to eq 'N/A'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user