Skip to content

Latest commit

 

History

History
97 lines (62 loc) · 3.12 KB

File metadata and controls

97 lines (62 loc) · 3.12 KB

ringcentral-js-widgets

Build Status Coverage Status Codacy Badge

Introduction

RingCentral integration widgets aim to provide reusable UI components to allow developers to integrate RingCentral unified communication service into third party processes or tools more easily.

This project is built based on RingCentral Integration Common Library and React. The basic idea is to connect modules in RingCentral Integration Common Library with React components to provide ready to use UI widgets.

Play with Development Server

A development server is delivered with source so that developers can use it to get familiar with the project or do further development. To get development server running:

Clone the repo:

$ git clone https://github.com/ringcentral/ringcentral-js-widgets.git
$ cd ringcentral-js-widgets

Install dependent libraries:

$ yarn install

Create a file named api-config.js in following format in folder dev-server to specify app related info

export default {
  appKey: ${app key},
  appSecret: ${app secret},
  server: ${server url},
};

Run following command to start development server

$ yarn dev-server

The development server is listening on port 8191 by default. Open up your browser and access http://localhost:8191 to see how it works.

Note that the development server is using OAuth for authorization process. Please make sure the app you specified in configuration above is setup with Redirect Uri http://localhost:8191/redirect.html.

Test

Create .env file in ./test/ folder, with the following content:

appKey=your-appKey
appSecret=your-appSecret
server=sever-url
username=your-phone-number
extension=your-extension
password=your-password
receiver=testing-phone-number-to-receive-sms-fax-etc

Run:

$ yarn test

If you want to run it in watch mode:

$ brew install watchman
$ yarn test:watch

Update mock data

Whenever there is major change to the design, you might need to update test/state.json and test/storage.json.

Launch the dev-server and visit the app in chrome browser. In console:

Run JSON.stringify(phone.store.getState(), null, 2) to generate content for test/state.json.

Run JSON.stringify(localStorage, null, 2) to generate content for test/storage.json

About test coverage

WebRTC code is excluded from test coverage report. Because we are unable to run WebRTC in node.js.

We might need to do some mocking to cover this part in the future.