|
@@ -41,6 +41,7 @@ describe('settings actions', () => {
|
|
|
it('should dispatch SET_APIKEY and SET_DOMAIN when getting user settings have been done', done => {
|
|
it('should dispatch SET_APIKEY and SET_DOMAIN when getting user settings have been done', done => {
|
|
|
const apikey = '123';
|
|
const apikey = '123';
|
|
|
const customDomain = 'test.com';
|
|
const customDomain = 'test.com';
|
|
|
|
|
+ const homepage = '';
|
|
|
|
|
|
|
|
nock('http://localhost', {
|
|
nock('http://localhost', {
|
|
|
reqheaders: {
|
|
reqheaders: {
|
|
@@ -48,14 +49,17 @@ describe('settings actions', () => {
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
.get('/api/auth/usersettings')
|
|
.get('/api/auth/usersettings')
|
|
|
- .reply(200, { apikey, customDomain });
|
|
|
|
|
|
|
+ .reply(200, { apikey, customDomain, homepage });
|
|
|
|
|
|
|
|
const store = mockStore({});
|
|
const store = mockStore({});
|
|
|
|
|
|
|
|
const expectedActions = [
|
|
const expectedActions = [
|
|
|
{
|
|
{
|
|
|
type: SET_DOMAIN,
|
|
type: SET_DOMAIN,
|
|
|
- payload: customDomain
|
|
|
|
|
|
|
+ payload: {
|
|
|
|
|
+ customDomain,
|
|
|
|
|
+ homepage: ''
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
type: SET_APIKEY,
|
|
type: SET_APIKEY,
|
|
@@ -76,6 +80,7 @@ describe('settings actions', () => {
|
|
|
describe('#setCustomDomain()', () => {
|
|
describe('#setCustomDomain()', () => {
|
|
|
it('should dispatch SET_DOMAIN when setting custom domain has been done', done => {
|
|
it('should dispatch SET_DOMAIN when setting custom domain has been done', done => {
|
|
|
const customDomain = 'test.com';
|
|
const customDomain = 'test.com';
|
|
|
|
|
+ const homepage = '';
|
|
|
|
|
|
|
|
nock('http://localhost', {
|
|
nock('http://localhost', {
|
|
|
reqheaders: {
|
|
reqheaders: {
|
|
@@ -83,7 +88,7 @@ describe('settings actions', () => {
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
.post('/api/url/customdomain')
|
|
.post('/api/url/customdomain')
|
|
|
- .reply(200, { customDomain });
|
|
|
|
|
|
|
+ .reply(200, { customDomain, homepage });
|
|
|
|
|
|
|
|
const store = mockStore({});
|
|
const store = mockStore({});
|
|
|
|
|
|
|
@@ -91,12 +96,18 @@ describe('settings actions', () => {
|
|
|
{ type: DOMAIN_LOADING },
|
|
{ type: DOMAIN_LOADING },
|
|
|
{
|
|
{
|
|
|
type: SET_DOMAIN,
|
|
type: SET_DOMAIN,
|
|
|
- payload: customDomain
|
|
|
|
|
|
|
+ payload: {
|
|
|
|
|
+ customDomain,
|
|
|
|
|
+ homepage: ''
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
];
|
|
];
|
|
|
|
|
|
|
|
store
|
|
store
|
|
|
- .dispatch(setCustomDomain(customDomain))
|
|
|
|
|
|
|
+ .dispatch(setCustomDomain({
|
|
|
|
|
+ customDomain,
|
|
|
|
|
+ homepage: ''
|
|
|
|
|
+ }))
|
|
|
.then(() => {
|
|
.then(() => {
|
|
|
expect(store.getActions()).to.deep.equal(expectedActions);
|
|
expect(store.getActions()).to.deep.equal(expectedActions);
|
|
|
done();
|
|
done();
|