Skip to content

Commit

Permalink
test: fixes tests to comply with new types
Browse files Browse the repository at this point in the history
  • Loading branch information
igorp1 committed Sep 6, 2024
1 parent ee05d90 commit a589a88
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/Stays/Stays.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('Stays', () => {
},
check_in_date: '2023-10-20',
check_out_date: '2023-10-24',
adults: 2,
guests: [{ type: 'adult' }, { type: 'adult' }, { type: 'child', age: 5 }],
rooms: 1,
}

Expand All @@ -44,7 +44,7 @@ describe('Stays', () => {
},
check_in_date: '2023-10-20',
check_out_date: '2023-10-24',
adults: 2,
guests: [{ type: 'adult' }, { type: 'adult' }, { type: 'child', age: 5 }],
rooms: 1,
}

Expand Down
9 changes: 2 additions & 7 deletions src/Stays/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ export const MOCK_ACCOMMODATION: StaysAccommodation = {
fee_amount: '40.00',
cancellation_timeline: [],
board_type: 'room_only',
payment_method: 'balance', // Deprecated. Refer to available_payment_methods instead.
available_payment_methods: ['balance'],
quantity_available: 1,
supported_loyalty_programme: null,
Expand Down Expand Up @@ -83,7 +82,6 @@ export const MOCK_ACCOMMODATION: StaysAccommodation = {
fee_amount: '40.00',
cancellation_timeline: [],
board_type: 'room_only',
payment_method: 'card', // Deprecated. Refer to available_payment_methods instead.
available_payment_methods: ['card'],
quantity_available: 1,
supported_loyalty_programme: 'duffel_hotel_group_rewards',
Expand Down Expand Up @@ -145,8 +143,6 @@ export const MOCK_ACCOMMODATION: StaysAccommodation = {
key_collection: {
instructions: 'Key is at the property. Collect from the lock box.',
},
cheapest_rate_total_amount: '799.00',
cheapest_rate_currency: 'GBP',
chain: {
name: 'The Ritz-Carlton',
},
Expand All @@ -158,9 +154,10 @@ export const MOCK_SEARCH_RESULT: StaysSearchResult = {
id: 'sta_something',
check_in_date: '2023-03-24',
check_out_date: '2023-03-28',
adults: 2,
rooms: 1,
guests: [{ type: 'adult' }, { type: 'adult' }],
cheapest_rate_total_amount: '799.00',
cheapest_rate_currency: 'GBP',
}

export const MOCK_BOOKING: StaysBooking = {
Expand Down Expand Up @@ -221,8 +218,6 @@ export const MOCK_QUOTE: StaysQuote = {
due_at_accommodation_amount: null,
due_at_accommodation_currency: 'USD',
supported_loyalty_programme: 'duffel_hotel_group_rewards',
card_component_key: null,
adults: 2,
rooms: 1,
guests: [{ type: 'adult' }, { type: 'adult' }],
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ export const mockAirlineInitiatedChange: AirlineInitiatedChange = {
city_name: 'Barcelona',
city: null,
},
changeable: null,
},
],
order_id: 'ord_00009hthhsUZ8W4LxQgkjo',
Expand Down Expand Up @@ -250,7 +249,6 @@ export const mockAirlineInitiatedChange: AirlineInitiatedChange = {
city_name: 'Barcelona',
city: null,
},
changeable: false,
},
],
action_taken_at: null,
Expand Down
3 changes: 2 additions & 1 deletion src/booking/Offers/mockOffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,8 @@ export const mockOffer: Offer = {
type: 'cancel_for_any_reason',
},
],
allowed_passenger_identity_document_types: ['passport'],
supported_passenger_identity_document_types: ['passport'],
supported_loyalty_programmes: [],
}

export const mockUpdatedOffer = {
Expand Down
3 changes: 2 additions & 1 deletion src/booking/Offers/mockPartialOffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,8 @@ export const mockPartialOffer: Offer = {
type: 'cancel_for_any_reason',
},
],
allowed_passenger_identity_document_types: ['passport'],
supported_passenger_identity_document_types: ['passport'],
supported_loyalty_programmes: [],
}

export const mockUpdatedOffer = {
Expand Down
6 changes: 3 additions & 3 deletions src/booking/Orders/mockOrders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export const mockCreateOrderRequest: CreateOrder = {
}

export const mockOrder: Order = {
available_actions: ['cancel', 'change'],
total_currency: 'GBP',
total_amount: '90.80',
tax_currency: 'GBP',
Expand Down Expand Up @@ -193,7 +194,6 @@ export const mockOrder: Order = {
allowed: true,
},
},
changeable: false,
},
],
services: [
Expand Down Expand Up @@ -273,6 +273,7 @@ export const mockOrder: Order = {

export const mockOnHoldOrders: Order[] = [
{
available_actions: ['cancel', 'change'],
total_currency: 'GBP',
total_amount: '87.90',
tax_currency: 'GBP',
Expand Down Expand Up @@ -395,7 +396,6 @@ export const mockOnHoldOrders: Order[] = [
conditions: {
change_before_departure: null,
},
changeable: null,
},
],
services: [],
Expand Down Expand Up @@ -441,6 +441,7 @@ export const mockOnHoldOrders: Order[] = [
base_amount: '72.00',
},
{
available_actions: ['cancel', 'change'],
total_currency: 'GBP',
total_amount: '110.50',
tax_currency: 'GBP',
Expand Down Expand Up @@ -561,7 +562,6 @@ export const mockOnHoldOrders: Order[] = [
},
},
conditions: { change_before_departure: null },
changeable: null,
},
],
services: [],
Expand Down

0 comments on commit a589a88

Please sign in to comment.