13
13
* See the License for the specific language governing permissions and
14
14
* limitations under the License.
15
15
*/
16
- let snippets = new Snippets ( ) ;
17
- let helpers = new Helpers ( ) ;
16
+ const helpers = new Helpers ( ) ;
18
17
19
18
// Constants
20
19
const IMAGE_URL =
@@ -68,7 +67,7 @@ function RUN_ALL_TESTS() {
68
67
*/
69
68
function itShouldCreateAPresentation ( ) {
70
69
console . log ( '> itShouldCreateAPresentation' ) ;
71
- const presentation = snippets . createPresentation ( ) ;
70
+ const presentation = createPresentation ( ) ;
72
71
expectToExist ( presentation . presentationId ) ;
73
72
helpers . deleteFileOnCleanup ( presentation . presentationId ) ;
74
73
}
@@ -79,7 +78,7 @@ function itShouldCreateAPresentation() {
79
78
function itShouldCopyAPresentation ( ) {
80
79
console . log ( '> itShouldCopyAPresentation' ) ;
81
80
const presentationId = helpers . createTestPresentation ( ) ;
82
- const copyId = snippets . copyPresentation ( presentationId , 'My Duplicate, Presentation' ) ;
81
+ const copyId = copyPresentation ( presentationId , 'My Duplicate, Presentation' ) ;
83
82
expectToExist ( copyId ) ;
84
83
helpers . deleteFileOnCleanup ( copyId ) ;
85
84
}
@@ -92,7 +91,7 @@ function itShouldCreateASlide() {
92
91
const presentationId = helpers . createTestPresentation ( ) ;
93
92
helpers . addSlides ( presentationId , 3 , 'TITLE_AND_TWO_COLUMNS' ) ;
94
93
const pageId = 'my_page_id' ;
95
- const response = snippets . createSlide ( presentationId , pageId ) ;
94
+ const response = createSlide ( presentationId , pageId ) ;
96
95
expectToExist ( response . replies [ 0 ] . createSlide . objectId ) ;
97
96
}
98
97
@@ -104,7 +103,7 @@ function itShouldCreateATextboxWithText() {
104
103
const presentationId = helpers . createTestPresentation ( ) ;
105
104
const ids = helpers . addSlides ( presentationId , 3 , 'TITLE_AND_TWO_COLUMNS' ) ;
106
105
const pageId = ids [ 0 ] ;
107
- const response = snippets . createTextboxWithText ( presentationId , pageId ) ;
106
+ const response = createTextboxWithText ( presentationId , pageId ) ;
108
107
expectToEqual ( 2 , response . replies . length ) ;
109
108
const boxId = response . replies [ 0 ] . createShape . objectId ;
110
109
expectToExist ( boxId ) ;
@@ -118,7 +117,7 @@ function itShouldCreateAnImage() {
118
117
const presentationId = helpers . createTestPresentation ( ) ;
119
118
const ids = helpers . addSlides ( presentationId , 1 , 'BLANK' ) ;
120
119
const pageId = ids [ 0 ] ;
121
- const response = snippets . createImage ( presentationId , pageId ) ;
120
+ const response = createImage ( presentationId , pageId ) ;
122
121
expectToEqual ( 1 , response . length ) ;
123
122
const imageId = response [ 0 ] . createImage . objectId ;
124
123
expectToExist ( imageId ) ;
@@ -129,7 +128,7 @@ function itShouldCreateAnImage() {
129
128
*/
130
129
function itShouldMergeText ( ) {
131
130
console . log ( '> itShouldMergeText' ) ;
132
- let responses = snippets . textMerging ( TEMPLATE_PRESENTATION_ID , DATA_SPREADSHEET_ID ) ;
131
+ let responses = textMerging ( TEMPLATE_PRESENTATION_ID , DATA_SPREADSHEET_ID ) ;
133
132
expectToEqual ( 5 , responses . length ) ;
134
133
responses . forEach ( function ( response ) {
135
134
let numReplacements = 0 ;
@@ -145,7 +144,7 @@ function itShouldMergeText() {
145
144
*/
146
145
function itShouldImageMerge ( ) {
147
146
console . log ( '> itShouldImageMerge' ) ;
148
- let response = snippets . imageMerging ( TEMPLATE_PRESENTATION_ID , IMAGE_URL , CUSTOMER_NAME ) ;
147
+ let response = imageMerging ( TEMPLATE_PRESENTATION_ID , IMAGE_URL , CUSTOMER_NAME ) ;
149
148
expectToEqual ( 2 , response . replies . length ) ;
150
149
let numReplacements = 0 ;
151
150
response . replies . forEach ( function ( reply ) {
@@ -163,7 +162,7 @@ function itShouldSimpleTextReplace() {
163
162
const pageIds = helpers . addSlides ( presentationId , 1 , 'BLANK' ) ;
164
163
const pageId = pageIds [ 0 ] ;
165
164
const boxId = helpers . createTestTextbox ( presentationId , pageId ) ;
166
- const response = snippets . simpleTextReplace ( presentationId , boxId , 'MY NEW TEXT' ) ;
165
+ const response = simpleTextReplace ( presentationId , boxId , 'MY NEW TEXT' ) ;
167
166
expectToEqual ( 2 , response . replies . length ) ;
168
167
}
169
168
@@ -176,7 +175,7 @@ function itShouldTextStyleUpdate() {
176
175
const pageIds = helpers . addSlides ( presentationId , 1 , 'BLANK' ) ;
177
176
const pageId = pageIds [ 0 ] ;
178
177
const boxId = helpers . createTestTextbox ( presentationId , pageId ) ;
179
- const response = snippets . textStyleUpdate ( presentationId , boxId ) ;
178
+ const response = textStyleUpdate ( presentationId , boxId ) ;
180
179
expectToEqual ( 3 , response . replies . length ) ;
181
180
}
182
181
@@ -189,7 +188,7 @@ function itShouldCreateBulletedText() {
189
188
const pageIds = helpers . addSlides ( presentationId , 1 , 'BLANK' ) ;
190
189
const pageId = pageIds [ 0 ] ;
191
190
const boxId = helpers . createTestTextbox ( presentationId , pageId ) ;
192
- const response = snippets . createBulletedText ( presentationId , boxId ) ;
191
+ const response = createBulletedText ( presentationId , boxId ) ;
193
192
expectToEqual ( 1 , response . replies . length ) ;
194
193
}
195
194
@@ -201,7 +200,7 @@ function itShouldCreateSheetsChart() {
201
200
const presentationId = helpers . createTestPresentation ( ) ;
202
201
const pageIds = helpers . addSlides ( presentationId , 1 , 'BLANK' ) ;
203
202
const pageId = pageIds [ 0 ] ;
204
- const response = snippets . createSheetsChart ( presentationId , pageId , DATA_SPREADSHEET_ID , CHART_ID ) ;
203
+ const response = createSheetsChart ( presentationId , pageId , DATA_SPREADSHEET_ID , CHART_ID ) ;
205
204
expectToEqual ( 1 , response . replies . length ) ;
206
205
const chartId = response . replies [ 0 ] . createSheetsChart . objectId ;
207
206
expectToExist ( chartId ) ;
@@ -217,6 +216,6 @@ function itShouldRefreshSheetsChart() {
217
216
const pageId = pageIds [ 0 ] ;
218
217
const sheetChartId = helpers . createTestSheetsChart ( presentationId , pageId , DATA_SPREADSHEET_ID ,
219
218
CHART_ID ) ;
220
- const response = snippets . refreshSheetsChart ( presentationId , sheetChartId ) ;
219
+ const response = refreshSheetsChart ( presentationId , sheetChartId ) ;
221
220
expectToEqual ( 1 , response . replies . length ) ;
222
- }
221
+ }
0 commit comments