upgrading react and refactoring components (#5409) (#5444)

- upgraded react from v16.2.0
- upgraded react-router to v4.2.0 and re-writen the routes
- using prettier to format the code
- added jest to unit test components/reducers/selectors

This provides a skeleton to start of with. Only basic unit test
cases are added, remaining needs to be added.

In terms of functionality, it provides login, listing and searching
buckets. Remaining functionalities will be added in upcoming patches.
This commit is contained in:
Kanagaraj M
2018-02-01 09:23:11 +05:30
committed by Harshavardhana
parent 76be54551f
commit 9ab6a8035f
41 changed files with 2896 additions and 2978 deletions

View File

@@ -14,30 +14,28 @@
* limitations under the License.
*/
import expect from 'expect';
import JSONrpc from '../jsonrpc';
import JSONrpc from "../jsonrpc"
describe('jsonrpc', () => {
it('should fail with invalid endpoint', (done) => {
describe("jsonrpc", () => {
it("should fail with invalid endpoint", done => {
try {
let jsonRPC = new JSONrpc({
endpoint: 'htt://localhost:9000',
namespace: 'Test'
});
endpoint: "htt://localhost:9000",
namespace: "Test"
})
} catch (e) {
done();
done()
}
});
it('should succeed with valid endpoint', () => {
})
it("should succeed with valid endpoint", () => {
let jsonRPC = new JSONrpc({
endpoint: 'http://localhost:9000/webrpc',
namespace: 'Test'
});
expect(jsonRPC.version).toEqual('2.0');
expect(jsonRPC.host).toEqual('localhost');
expect(jsonRPC.port).toEqual('9000');
expect(jsonRPC.path).toEqual('/webrpc');
expect(jsonRPC.scheme).toEqual('http');
});
});
endpoint: "http://localhost:9000/webrpc",
namespace: "Test"
})
expect(jsonRPC.version).toEqual("2.0")
expect(jsonRPC.host).toEqual("localhost")
expect(jsonRPC.port).toEqual("9000")
expect(jsonRPC.path).toEqual("/webrpc")
expect(jsonRPC.scheme).toEqual("http")
})
})