( framework: string, harness: PrimitiveHarness, components: ContextPrimitiveComponents, )
| 62 | }; |
| 63 | |
| 64 | export const testContextPrimitives = ( |
| 65 | framework: string, |
| 66 | harness: PrimitiveHarness, |
| 67 | components: ContextPrimitiveComponents, |
| 68 | ): void => { |
| 69 | let things: ContextPrimitiveProps; |
| 70 | |
| 71 | beforeEach(() => { |
| 72 | things = createTestThings(); |
| 73 | }); |
| 74 | |
| 75 | describe(`${framework} context primitive scenarios`, () => { |
| 76 | test('provided things and ids', () => { |
| 77 | const {container, unmount} = harness.render(components.Things, things); |
| 78 | expect(container.textContent).toEqual( |
| 79 | JSON.stringify([ |
| 80 | ['store1'], |
| 81 | ['metrics1'], |
| 82 | ['indexes1'], |
| 83 | ['relationships1'], |
| 84 | ['queries1'], |
| 85 | ['checkpoints1'], |
| 86 | ['persister1'], |
| 87 | ['synchronizer1'], |
| 88 | ...(components.hasStores ? [true] : []), |
| 89 | true, |
| 90 | true, |
| 91 | true, |
| 92 | true, |
| 93 | true, |
| 94 | true, |
| 95 | true, |
| 96 | true, |
| 97 | ]), |
| 98 | ); |
| 99 | unmount(); |
| 100 | }); |
| 101 | |
| 102 | test('missing context', () => { |
| 103 | const {container, unmount} = harness.render(components.NoContext, {}); |
| 104 | expect(container.textContent).toEqual( |
| 105 | JSON.stringify([[], [], [], [], [], [], [], []]), |
| 106 | ); |
| 107 | unmount(); |
| 108 | }); |
| 109 | }); |
| 110 | }; |
no test coverage detected
searching dependent graphs…