Skip to content

Commit

Permalink
chore: enabling linting on __tests__ for the react-native packages (#…
Browse files Browse the repository at this point in the history
…13545)

* chore: enabling linting on __tests__ for the react-native packages

* chore(rtn-push-notification): run yarn lint:fix

* chore(rtn-push-notification): manual fix linter errors
  • Loading branch information
HuiSF authored Jun 26, 2024
1 parent 2ef7c59 commit b6de5f9
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 18 deletions.
12 changes: 0 additions & 12 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,13 @@ module.exports = {
'setupTests.ts',
'jest.setup.*',
'jest.config.*',
// 'packages/adapter-nextjs/__tests__',
// 'packages/analytics/__tests__',
'packages/api/__tests__',
'packages/api-graphql/__tests__',
// 'packages/api-rest/__tests__',
// 'packages/auth/__tests__',
// 'packages/aws-amplify/__tests__',
// 'packages/core/__tests__',
'packages/datastore/__tests__',
'packages/datastore-storage-adapter/__tests__',
// 'packages/geo/__tests__',
'packages/interactions/__tests__',
// 'packages/notifications/__tests__',
'packages/predictions/__tests__',
'packages/pubsub/__tests__',
'packages/react-native/__tests__',
'packages/rtn-push-notification/__tests__',
'packages/rtn-web-browser/__tests__',
// 'packages/storage/__tests__',
],
rules: {
camelcase: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe('getPermissionStatus', () => {
beforeAll(() => {
mockGetPermissionStatusNative.mockResolvedValue(status);
mockNormalizeNativePermissionStatus.mockImplementation(
status => `normalized-${status}`,
statusParam => `normalized-${statusParam}`,
);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

import { AppRegistry } from 'react-native';

import { getConstants } from '../../src/apis/getConstants';
import { registerHeadlessTask } from '../../src/apis/registerHeadlessTask';
import { normalizeNativeMessage } from '../../src/utils';
Expand Down
2 changes: 1 addition & 1 deletion packages/rtn-push-notification/__tests__/testUtils/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const fcmMessageOptions = {
export const fcmMessagePayload = {
title: 'fcm-title',
body: 'fcm-body',
imageUrl: imageUrl,
imageUrl,
action: {},
rawData: pushNotificationAdhocData,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import {
apnsMessage,
apnsMessagePayload,
fcmMessage,
fcmMessagePayload,
fcmMessageOptions,
fcmMessagePayload,
imageUrl,
pushNotificationAdhocData,
pushNotificationDeeplinkUrl,
Expand All @@ -23,7 +23,7 @@ describe('normalizeNativeMessage', () => {
expect(normalizeNativeMessage(apnsMessage)).toStrictEqual({
title,
body,
imageUrl: imageUrl,
imageUrl,
data: {
...pushNotificationAdhocData,
'media-url': imageUrl,
Expand Down Expand Up @@ -72,12 +72,17 @@ describe('normalizeNativeMessage', () => {

describe('fcm messages', () => {
it('normalizes typical messages', () => {
const { body, rawData, imageUrl, title } = fcmMessagePayload;
const {
body,
rawData,
imageUrl: imageUrlFromPayload,
title,
} = fcmMessagePayload;

expect(normalizeNativeMessage(fcmMessage)).toStrictEqual({
body,
data: rawData,
imageUrl,
imageUrl: imageUrlFromPayload,
title,
fcmOptions: {
...fcmMessageOptions,
Expand Down

0 comments on commit b6de5f9

Please sign in to comment.