Skip to content

Commit

Permalink
fix: notifications imports
Browse files Browse the repository at this point in the history
  • Loading branch information
ncomerci committed Oct 25, 2023
1 parent 3768788 commit 658ca51
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/back/services/notification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { areValidAddresses } from '../utils/validations'

import { CoauthorService } from './coauthor'

const PushAPI = NOTIFICATIONS_SERVICE_ENABLED ? require('@pushprotocol/restapi') : null
import PushAPI = require('@pushprotocol/restapi')

const chainId = isProdEnv() ? ChainId.ETHEREUM_MAINNET : ChainId.ETHEREUM_GOERLI
const PUSH_CHANNEL_OWNER_PK = process.env.PUSH_CHANNEL_OWNER_PK
Expand Down
2 changes: 1 addition & 1 deletion src/components/Banner/Banner.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
right: 0;
margin: 8px;
background-color: #f1f6fe;
z-index: 10;
z-index: 8;
}

.Banner .Banner__Button {
Expand Down
2 changes: 2 additions & 0 deletions src/entities/Proposal/jobs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ jest.mock('../../constants', () => ({
NOTIFICATIONS_SERVICE_ENABLED: false,
}))

jest.mock('@pushprotocol/restapi/src/index.js', () => jest.fn())

describe('finishProposals', () => {
beforeAll(() => {
jest.spyOn(ProposalModel, 'finishProposal')
Expand Down
2 changes: 2 additions & 0 deletions src/entities/QuarterBudget/model.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ const VALID_QUARTER_BUDGET_2 = {
updated_at: NOW,
}

jest.mock('@pushprotocol/restapi/src/index.js', () => jest.fn())

describe('QuarterBudgetModel', () => {
describe('createNewBudgets', () => {
beforeEach(() => {
Expand Down
2 changes: 2 additions & 0 deletions src/entities/QuarterBudget/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ const EXISTING_BUDGETS: QuarterBudgetAttributes[] = [
{ ...TEST_DATA, start_at: QUARTER_2_START_DATE, finish_at: QUARTER_2_END_DATE },
]

jest.mock('@pushprotocol/restapi/src/index.js', () => jest.fn())

describe('thereAreNoOverlappingBudgets', () => {
it('returns true when no budgets overlap with the given dates', () => {
const startAt = Time(QUARTER_2_END_DATE).add(1, 'day').toDate()
Expand Down
2 changes: 2 additions & 0 deletions src/entities/QuarterCategoryBudget/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { NewGrantCategory } from '../Grant/types'

import { getCategoryBudgetTotal, toNewGrantCategory, validateCategoryBudgets } from './utils'

jest.mock('@pushprotocol/restapi/src/index.js', () => jest.fn())

describe('getCategoryBudgetTotal', () => {
it('returns a percentage of the budget total', () => {
expect(getCategoryBudgetTotal(10, 100)).toEqual(10)
Expand Down
2 changes: 2 additions & 0 deletions src/services/BudgetService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ jest.mock('../constants', () => ({
NOTIFICATIONS_SERVICE_ENABLED: false,
}))

jest.mock('@pushprotocol/restapi/src/index.js', () => jest.fn())

describe('BudgetService', () => {
describe('getTransparencyBudgets', () => {
beforeAll(() => {
Expand Down

0 comments on commit 658ca51

Please sign in to comment.