Skip to content

Commit

Permalink
fix nft filters (#1344)
Browse files Browse the repository at this point in the history
* fix nft filters

* fix failing unit tests
  • Loading branch information
bogdan-rosianu authored Oct 4, 2024
1 parent 4e16e63 commit ca238af
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/common/indexer/elastic/elastic.indexer.helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ export class ElasticIndexerHelper {
}

if (filter.excludeMetaESDT === true) {
elasticQuery = elasticQuery.withMustMultiShouldCondition([NftType.SemiFungibleESDT, NftType.NonFungibleESDT], type => QueryType.Match('type', type));
elasticQuery = elasticQuery.withMustMultiShouldCondition([...this.nonFungibleEsdtTypes, ...this.semiFungibleEsdtTypes], type => QueryType.Match('type', type));
}

return elasticQuery;
Expand Down
8 changes: 4 additions & 4 deletions src/test/unit/services/mex.token.charts.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe('MexTokenChartsService', () => {

jest.spyOn(graphQlService, 'getExchangeServiceData').mockResolvedValue(mockData);
jest.spyOn(mexTokenService, 'getMexTokenByIdentifier').mockResolvedValue(mockToken);
jest.spyOn(mexTokenChartsService as any, 'checkTokenExists').mockReturnValue(true);
jest.spyOn(mexTokenChartsService as any, 'isMexToken').mockReturnValue(true);

const result = await mexTokenChartsService.getTokenPricesHourResolutionRaw('TOKEN-123456');

Expand All @@ -71,7 +71,7 @@ describe('MexTokenChartsService', () => {

it('should return an empty array when no data is available', async () => {
jest.spyOn(graphQlService, 'getExchangeServiceData').mockResolvedValue({});
jest.spyOn(mexTokenChartsService as any, 'checkTokenExists').mockReturnValue(true);
jest.spyOn(mexTokenChartsService as any, 'isMexToken').mockReturnValue(true);

const result = await mexTokenChartsService.getTokenPricesHourResolutionRaw('TOKEN-123456');

Expand All @@ -92,7 +92,7 @@ describe('MexTokenChartsService', () => {

jest.spyOn(graphQlService, 'getExchangeServiceData').mockResolvedValue(mockData);
jest.spyOn(mexTokenService, 'getMexTokenByIdentifier').mockResolvedValue(mockToken);
jest.spyOn(mexTokenChartsService as any, 'checkTokenExists').mockReturnValue(true);
jest.spyOn(mexTokenChartsService as any, 'isMexToken').mockReturnValue(true);

const result = await mexTokenChartsService.getTokenPricesDayResolutionRaw('TOKEN-123456', '1683561648');

Expand All @@ -106,7 +106,7 @@ describe('MexTokenChartsService', () => {

it('should return an empty array when no data is available', async () => {
jest.spyOn(graphQlService, 'getExchangeServiceData').mockResolvedValue({});
jest.spyOn(mexTokenChartsService as any, 'checkTokenExists').mockReturnValue(true);
jest.spyOn(mexTokenChartsService as any, 'isMexToken').mockReturnValue(true);
const result = await mexTokenChartsService.getTokenPricesDayResolutionRaw('TOKEN-123456', '1683561648');

expect(result).toEqual([]);
Expand Down

0 comments on commit ca238af

Please sign in to comment.