mirror of
				https://codeberg.org/yeentown/barkey.git
				synced 2025-11-01 05:54:12 +00:00 
			
		
		
		
	merge: fix time zone for CustomEmojiService test (!909)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/909 Approved-by: Hazelnoot <acomputerdog@gmail.com> Approved-by: Marie <github@yuugi.dev>
This commit is contained in:
		
						commit
						0bec7fe2a2
					
				
					 2 changed files with 4 additions and 2 deletions
				
			
		|  | @ -520,11 +520,11 @@ export class CustomEmojiService implements OnApplicationShutdown { | ||||||
| 			const q = params.query; | 			const q = params.query; | ||||||
| 			if (q.updatedAtFrom) { | 			if (q.updatedAtFrom) { | ||||||
| 				// noIndexScan
 | 				// noIndexScan
 | ||||||
| 				builder.andWhere('CAST(emoji.updatedAt AS DATE) >= :updateAtFrom', { updateAtFrom: q.updatedAtFrom }); | 				builder.andWhere('CAST(emoji.updatedAt AS DATE) >= :updatedAtFrom', { updatedAtFrom: q.updatedAtFrom }); | ||||||
| 			} | 			} | ||||||
| 			if (q.updatedAtTo) { | 			if (q.updatedAtTo) { | ||||||
| 				// noIndexScan
 | 				// noIndexScan
 | ||||||
| 				builder.andWhere('CAST(emoji.updatedAt AS DATE) <= :updateAtTo', { updateAtTo: q.updatedAtTo }); | 				builder.andWhere('CAST(emoji.updatedAt AS DATE) <= :updatedAtTo', { updatedAtTo: q.updatedAtTo }); | ||||||
| 			} | 			} | ||||||
| 			if (q.name) { | 			if (q.name) { | ||||||
| 				builder.andWhere('emoji.name ~~ ANY(ARRAY[:...name])', { name: multipleWordsToQuery(q.name) }); | 				builder.andWhere('emoji.name ~~ ANY(ARRAY[:...name])', { name: multipleWordsToQuery(q.name) }); | ||||||
|  |  | ||||||
|  | @ -17,6 +17,7 @@ import { EmojisRepository } from '@/models/_.js'; | ||||||
| import { MiEmoji } from '@/models/Emoji.js'; | import { MiEmoji } from '@/models/Emoji.js'; | ||||||
| import { CoreModule } from '@/core/CoreModule.js'; | import { CoreModule } from '@/core/CoreModule.js'; | ||||||
| import { DriveService } from '@/core//DriveService.js'; | import { DriveService } from '@/core//DriveService.js'; | ||||||
|  | import { DataSource } from 'typeorm'; | ||||||
| 
 | 
 | ||||||
| describe('CustomEmojiService', () => { | describe('CustomEmojiService', () => { | ||||||
| 	let app: TestingModule; | 	let app: TestingModule; | ||||||
|  | @ -48,6 +49,7 @@ describe('CustomEmojiService', () => { | ||||||
| 		service = app.get<CustomEmojiService>(CustomEmojiService); | 		service = app.get<CustomEmojiService>(CustomEmojiService); | ||||||
| 		emojisRepository = app.get<EmojisRepository>(DI.emojisRepository); | 		emojisRepository = app.get<EmojisRepository>(DI.emojisRepository); | ||||||
| 		idService = app.get<IdService>(IdService); | 		idService = app.get<IdService>(IdService); | ||||||
|  | 		await app.get<DataSource>(DI.db).query("set session time zone 'UTC'"); | ||||||
| 	}); | 	}); | ||||||
| 
 | 
 | ||||||
| 	describe('fetchEmojis', () => { | 	describe('fetchEmojis', () => { | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue