1
1
import ConsumerApi from '../Consumer.api' ;
2
2
3
3
import {
4
- CONSUMER_DETAILS_URL ,
4
+ GET_CONSUMER_DETAILS_URL ,
5
+ PATCH_CONSUMER_DETAILS_URL ,
5
6
CONSUMER_ADDRESSES_URL ,
6
- AUTHORISATION_HEADER_NAME
7
+ AUTHORISATION_HEADER_NAME ,
8
+ ACCEPT_TENANT_HEADER_NAME
7
9
} from '../../../constants' ;
8
10
import {
9
11
baseUrl ,
@@ -52,9 +54,10 @@ describe('ConsumerApi Provider', () => {
52
54
describe ( 'When calling `getConsumerDetails`' , ( ) => {
53
55
it ( 'should send the correct parameters' , async ( ) => {
54
56
// Arrange
55
- const expectedUri = `${ baseUrl } /${ CONSUMER_DETAILS_URL } ` ;
57
+ const expectedUri = `${ baseUrl } /${ GET_CONSUMER_DETAILS_URL } ` ;
56
58
const expectedHeaders = {
57
- [ AUTHORISATION_HEADER_NAME ] : `Bearer ${ token } `
59
+ [ AUTHORISATION_HEADER_NAME ] : `Bearer ${ token } ` ,
60
+ [ ACCEPT_TENANT_HEADER_NAME ] : 'uk'
58
61
} ;
59
62
60
63
// Act
@@ -70,7 +73,8 @@ describe('ConsumerApi Provider', () => {
70
73
// Arrange
71
74
const expectedUri = `${ baseUrl } /${ CONSUMER_ADDRESSES_URL } ` ;
72
75
const expectedHeaders = {
73
- [ AUTHORISATION_HEADER_NAME ] : `Bearer ${ token } `
76
+ [ AUTHORISATION_HEADER_NAME ] : `Bearer ${ token } ` ,
77
+ [ ACCEPT_TENANT_HEADER_NAME ] : 'uk'
74
78
} ;
75
79
76
80
// Act
@@ -84,10 +88,11 @@ describe('ConsumerApi Provider', () => {
84
88
describe ( 'When calling `patchConsumer`' , ( ) => {
85
89
it ( 'should send the correct parameters' , async ( ) => {
86
90
// Arrange
87
- const expectedUri = `${ baseUrl } /${ CONSUMER_DETAILS_URL } ` ;
91
+ const expectedUri = `${ baseUrl } /${ PATCH_CONSUMER_DETAILS_URL } ` ;
88
92
const expectedBody = consumerUpdateBody ;
89
93
const expectedHeaders = {
90
- [ AUTHORISATION_HEADER_NAME ] : `Bearer ${ token } `
94
+ [ AUTHORISATION_HEADER_NAME ] : `Bearer ${ token } ` ,
95
+ [ ACCEPT_TENANT_HEADER_NAME ] : 'uk'
91
96
} ;
92
97
93
98
// Act
0 commit comments