@@ -55,7 +55,7 @@ describe("getBranding", () => {
55
55
await Promise . all ( [
56
56
db . prepare ( "run" , titleVotesQuery , [ "UUID1" , 3 , 0 , 0 , 0 , 0 , 0 ] ) ,
57
57
db . prepare ( "run" , titleVotesQuery , [ "UUID2" , 3 , 0 , 0 , 0 , 1 , 0 ] ) ,
58
- db . prepare ( "run" , titleVotesQuery , [ "UUID3" , 1 , 0 , 0 , 0 , 0 , 0 ] ) ,
58
+ db . prepare ( "run" , titleVotesQuery , [ "UUID3" , 0 , 0 , 0 , 0 , 0 , 0 ] ) ,
59
59
db . prepare ( "run" , titleVotesQuery , [ "UUID4" , 5 , 0 , 0 , 0 , 0 , 1 ] ) ,
60
60
db . prepare ( "run" , thumbnailTimestampsQuery , [ "UUID1T" , 1 ] ) ,
61
61
db . prepare ( "run" , thumbnailTimestampsQuery , [ "UUID3T" , 3 ] ) ,
@@ -133,7 +133,7 @@ describe("getBranding", () => {
133
133
} ) ;
134
134
135
135
it ( "should get top titles and thumbnails" , async ( ) => {
136
- await checkVideo ( videoID1 , videoID1Hash , {
136
+ await checkVideo ( videoID1 , videoID1Hash , false , {
137
137
titles : [ {
138
138
title : "title1" ,
139
139
original : false ,
@@ -149,7 +149,7 @@ describe("getBranding", () => {
149
149
} , {
150
150
title : "title3" ,
151
151
original : true ,
152
- votes : 1 ,
152
+ votes : 0 ,
153
153
locked : false ,
154
154
UUID : "UUID3" as BrandingUUID
155
155
} ] ,
@@ -175,7 +175,7 @@ describe("getBranding", () => {
175
175
} ) ;
176
176
177
177
it ( "should get top titles and thumbnails prioritizing locks" , async ( ) => {
178
- await checkVideo ( videoID2Locked , videoID2LockedHash , {
178
+ await checkVideo ( videoID2Locked , videoID2LockedHash , false , {
179
179
titles : [ {
180
180
title : "title3" ,
181
181
original : true ,
@@ -217,7 +217,7 @@ describe("getBranding", () => {
217
217
} ) ;
218
218
219
219
it ( "should get top titles and hide shadow hidden" , async ( ) => {
220
- await checkVideo ( videoID2ShadowHide , videoID2ShadowHideHash , {
220
+ await checkVideo ( videoID2ShadowHide , videoID2ShadowHideHash , false , {
221
221
titles : [ {
222
222
title : "title1" ,
223
223
original : false ,
@@ -271,7 +271,7 @@ describe("getBranding", () => {
271
271
} ) ;
272
272
273
273
it ( "should get top titles and thumbnails that are unverified" , async ( ) => {
274
- await checkVideo ( videoIDUnverified , videoIDUnverifiedHash , {
274
+ await checkVideo ( videoIDUnverified , videoIDUnverifiedHash , true , {
275
275
titles : [ {
276
276
title : "title1" ,
277
277
original : false ,
@@ -312,12 +312,12 @@ describe("getBranding", () => {
312
312
} ) ;
313
313
} ) ;
314
314
315
- async function checkVideo ( videoID : string , videoIDHash : string , expected : {
315
+ async function checkVideo ( videoID : string , videoIDHash : string , fetchAll : boolean , expected : {
316
316
titles : TitleResult [ ] ,
317
317
thumbnails : ThumbnailResult [ ]
318
318
} ) {
319
- const result1 = await getBranding ( { videoID, fetchAll : true } ) ;
320
- const result2 = await getBrandingByHash ( videoIDHash , { fetchAll : true } ) ;
319
+ const result1 = await getBranding ( { videoID, fetchAll } ) ;
320
+ const result2 = await getBrandingByHash ( videoIDHash , { fetchAll } ) ;
321
321
322
322
assert . strictEqual ( result1 . status , 200 ) ;
323
323
assert . strictEqual ( result2 . status , 200 ) ;
0 commit comments