From fe3a953c38cd5db1cccc63cf2ac01c4689b8386b Mon Sep 17 00:00:00 2001 From: Peter Velkov Date: Fri, 25 Nov 2022 01:38:52 +0200 Subject: [PATCH] [test] clearer descriptions --- .../src/exports/Image/__tests__/index-test.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/react-native-web/src/exports/Image/__tests__/index-test.js b/packages/react-native-web/src/exports/Image/__tests__/index-test.js index ea8a1b9d21..c9c0828f00 100644 --- a/packages/react-native-web/src/exports/Image/__tests__/index-test.js +++ b/packages/react-native-web/src/exports/Image/__tests__/index-test.js @@ -173,7 +173,7 @@ describe('components/Image', () => { expect(onLoadEndStub.mock.calls.length).toBe(2); }); - test('is called on update if "headers" are different', () => { + test('is called on update if "headers" are modified', () => { const onLoadStartStub = jest.fn(); const onLoadStub = jest.fn(); const onLoadEndStub = jest.fn(); @@ -257,7 +257,9 @@ describe('components/Image', () => { expect(onLoadEndStub.mock.calls.length).toBe(1); }); - test('is not called on update if "headers" and "uri" the same', () => { + // This test verifies that wen source is declared in-line and the parent component + // re-renders we aren't restarting the load process because the source is structurally equal + test('is not called on update when "headers" and "uri" are not modified', () => { const onLoadStartStub = jest.fn(); const onLoadStub = jest.fn(); const onLoadEndStub = jest.fn();