Skip to content

Commit 6e3909f

Browse files
committed
test(TestWireAdapter) add test for Apex adapter
1 parent bbe6ee0 commit 6e3909f

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

test/modules/example/apex/__tests__/apex-adapter.test.js

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ describe('ApexTestWireAdapter', () => {
201201
cases.forEach(({ testName, adapter, adapterName}) => {
202202
describe(testName, ()=> {
203203
describe('getLastConfig()', () => {
204-
it('should return last available config', () => {
204+
it('should return last available config', async () => {
205205
const element = createElement('example-apex', { is: Apex });
206206
element.param = `v1-${adapterName}`;
207207

@@ -219,6 +219,28 @@ describe('ApexTestWireAdapter', () => {
219219
});
220220
});
221221

222+
describe('resetLastConfig', () => {
223+
test('getLastConfig() should return the last available config despite we run a new set of test', () => {
224+
//Arrange
225+
const actual = adapter.getLastConfig();
226+
227+
// Assert
228+
expect(actual).not.toBeNull();
229+
});
230+
231+
it('should reset the last available', () => {
232+
// Arrange
233+
let actual;
234+
235+
//Act
236+
adapter.resetLastConfig();
237+
actual = adapter.getLastConfig();
238+
239+
// Assert
240+
expect(actual).toBeNull();
241+
});
242+
});
243+
222244
describe('emit()', () => {
223245
it('should emit default value when component is created but not connected', () => {
224246
const element = createElement('example-apex', { is: Apex });

0 commit comments

Comments
 (0)