Skip to content

Commit

Permalink
fix: mock lookupDomainName in add-contact.test.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt561 committed Nov 4, 2024
1 parent 20e2625 commit efd4d8f
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions ui/pages/settings/contact-list-tab/add-contact/add-contact.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,17 @@ describe('AddContact component', () => {
resetDomainResolution: jest.fn(),
};

beforeEach(() => {
jest.resetAllMocks();
jest
.spyOn(domainDucks, 'lookupDomainName')
.mockImplementation(() => jest.fn());
});

afterAll(() => {
jest.restoreAllMocks();
});

it('should render the component with correct properties', () => {
const store = configureMockStore(middleware)(state);

Expand Down Expand Up @@ -151,10 +162,6 @@ describe('AddContact component', () => {
});

it('should display error when ENS inserts a name that is already in use', () => {
jest
.spyOn(domainDucks, 'lookupDomainName')
.mockImplementation(() => jest.fn());

const store = configureMockStore(middleware)(state);

const { getByTestId, getByText } = renderWithProvider(
Expand Down

0 comments on commit efd4d8f

Please sign in to comment.