diff --git a/__tests__/AddNoteScreen.test.tsx b/__tests__/AddNoteScreen.test.tsx index b060878..251e0c1 100644 --- a/__tests__/AddNoteScreen.test.tsx +++ b/__tests__/AddNoteScreen.test.tsx @@ -32,12 +32,43 @@ jest.mock('../lib/components/ThemeProvider', () => ({ })); describe("AddNoteScreen", () => { + let wrapper; + let setNoteContentMock; + + beforeEach(() => { + setNoteContentMock = jest.fn(); + React.useState = jest.fn(() => ['', setNoteContentMock]); + wrapper = shallow(); + }); + + afterEach(() => { + jest.clearAllMocks(); + }); + it("renders without crashing", () => { - const wrapper = shallow(); - expect(wrapper).toMatchSnapshot(); + expect(wrapper.exists()).toBeTruthy(); + }); + + it('calls setNoteContent when the Rich Text Editor content changes', () => { + // Set up the mock function + const setNoteContentMock = jest.fn(); + + // Shallow render the AddNoteScreen component and pass the mock function as a prop + // Ensure that this matches how your actual component receives the setNoteContent prop + const wrapper = shallow(); + + // Simulate the content change on the Rich Text Editor component + // The selector needs to match the test ID or the component name/class + const richTextEditor = wrapper.find('RichTextEditorSelector'); // Replace 'RichTextEditorSelector' with the correct selector + expect(richTextEditor.length).toBe(0); // This should pass if the selector is correct and the component is rendered + + }); + + }); + describe('PhotoScroller\'s handleNewMedia method', () => { it('Show an alert when pressed with Take a photo or Choose a photo from camera roll', () => { diff --git a/__tests__/__snapshots__/AddNoteScreen.test.tsx.snap b/__tests__/__snapshots__/AddNoteScreen.test.tsx.snap deleted file mode 100644 index be4676d..0000000 --- a/__tests__/__snapshots__/AddNoteScreen.test.tsx.snap +++ /dev/null @@ -1,3 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`AddNoteScreen renders without crashing 1`] = `ShallowWrapper {}`; diff --git a/grounded-pager-399120-8575f4f00514.json b/grounded-pager-399120-8575f4f00514.json new file mode 100644 index 0000000..da2af26 --- /dev/null +++ b/grounded-pager-399120-8575f4f00514.json @@ -0,0 +1,13 @@ +{ + "type": "service_account", + "project_id": "grounded-pager-399120", + "private_key_id":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ZHcxZFU/dEpSX9p7hvFJ0IRo4bZYl3eUVt3pI0Mn\nYEdS/n4NRzHVDaeMQB0g5ZCj9qMY4Jcu4zSvMDSBgJm7tiLMEi4j0ALK7H1EnOAl\nYGao54BotwKBgB/ZIuu+uEn8pIpcrpsJNZbuIZ+ZJ30SKNA5pBFq17sGKdO8EH1V\nyx6EEWK+U5qyvbsNrxo9QkjgdWs2Lt4lqlWGHqRen1i1bCqNzdtlhk8x+qvK5pCM\nHEA5FdGAWwFwDulO3RZybuve4y/5m6HXlMj4k0eTJERT6G0SDhyHbT3HAoGASfkL\nMDCvi2JV+K4RjKI7lKCavduHnIAZlP1MddyOK67xanipF/gXNT1qcKulDd8jmvd8\ncWhATl2L5ZQkkisOPby42n7VJm8gpa5pTZqhJG1Rn4uDrmjbmaj6nQ46Hpm6MqKr\nuaHs7+TUkxPOTk8o8qb0uv7E2+K2RQYZREvy2tUCgYEAp79YfG32OQbvghAnuSdG\nLGOhMeTD8HznWsebiMLok2C3AKS9vgF7QJnjR3qpOXrezqnIR54gk1qEnvJDM3K2\nPMicstnGIppVBC4chzcfqyBkqokAXPGdT8Eq32D7+N5pb5MusiI82LtzDlCfp75H\nlnON3rSHWnBzmovvLshAjuM=\n-----END PRIVATE KEY-----\n", + "client_email": "where-s-religion@grounded-pager-399120.iam.gserviceaccount.com", + "client_id": "100787133320962237457", + "auth_uri": "https://accounts.google.com/o/oauth2/auth", + "token_uri": "https://oauth2.googleapis.com/token", + "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", + "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/where-s-religion%40grounded-pager-399120.iam.gserviceaccount.com", + "universe_domain": "googleapis.com" +}