"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "flow-client/src/test/frontend/ConnectTests.ts" between
vaadin-flow-4.0.5.tar.gz and vaadin-flow-4.0.6.tar.gz

About: Vaadin flow is a Java framework binding Vaadin web components to Java.

ConnectTests.ts  (vaadin-flow-4.0.5):ConnectTests.ts  (vaadin-flow-4.0.6)
skipping to change at line 134 skipping to change at line 134
expect(fetchMock.lastOptions()).to.include({method: 'POST'}); expect(fetchMock.lastOptions()).to.include({method: 'POST'});
}); });
it('should call Flow.loading indicator', async() => { it('should call Flow.loading indicator', async() => {
let calls = ''; let calls = '';
(window as any).Vaadin.Flow = {loading: (action: boolean) => calls += acti on}; (window as any).Vaadin.Flow = {loading: (action: boolean) => calls += acti on};
await client.call('FooEndpoint', 'fooMethod'); await client.call('FooEndpoint', 'fooMethod');
expect(calls).to.equal('truefalse'); expect(calls).to.equal('truefalse');
}); });
it('should hide Flow.loading indicator upon network failure', async() => {
let calls = '';
(window as any).Vaadin.Flow = {loading: (action: boolean) => calls += acti
on};
fetchMock.post(
base + '/connect/FooEndpoint/reject',
Promise.reject(new TypeError('Network failure'))
);
try {
await client.call('FooEndpoint', 'reject');
} catch (error) {
// expected
} finally {
expect(calls).to.equal('truefalse');
}
});
it('should hide Flow.loading indicator upon server error', async() => {
const body = 'Unexpected error';
const errorResponse = new Response(
body,
{
status: 500,
statusText: 'Internal Server Error'
}
);
fetchMock.post(base + '/connect/FooEndpoint/vaadinConnectResponse', errorR
esponse);
let calls = '';
(window as any).Vaadin.Flow = {loading: (action: boolean) => calls += acti
on};
try {
await client.call('FooEndpoint', 'vaadinConnectResponse');
} catch (error) {
// expected
} finally {
expect(calls).to.equal('truefalse');
}
});
it('should use JSON request headers', async() => { it('should use JSON request headers', async() => {
await client.call('FooEndpoint', 'fooMethod'); await client.call('FooEndpoint', 'fooMethod');
const headers = fetchMock.lastOptions().headers; const headers = fetchMock.lastOptions().headers;
expect(headers).to.deep.include({ expect(headers).to.deep.include({
'accept': 'application/json', 'accept': 'application/json',
'content-type': 'application/json' 'content-type': 'application/json'
}); });
}); });
 End of changes. 1 change blocks. 
0 lines changed or deleted 41 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)