-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #227 from labzero/develop
Merge to master
- Loading branch information
Showing
8 changed files
with
510 additions
and
567 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
/* eslint-env mocha */ | ||
/* eslint-disable no-unused-expressions */ | ||
import React from 'react'; | ||
import { expect } from 'chai'; | ||
import { shallow } from 'enzyme'; | ||
import AddUserForm from './AddUserForm'; | ||
|
||
describe('AddUserForm', () => { | ||
let props; | ||
|
||
beforeEach(() => { | ||
props = { | ||
intl: { | ||
formatMessage: () => {} | ||
} | ||
}; | ||
}); | ||
|
||
describe('the options for the User Type form', () => { | ||
it('includes an option for guest if the hasGuestRole prop is true', () => { | ||
props.hasGuestRole = true; | ||
|
||
const wrapper = shallow(<AddUserForm {...props} />); | ||
|
||
expect(wrapper.contains(<option value="guest" />)).to.be.true; | ||
}); | ||
|
||
it('does not include an option for guest if the hasGuestRole prop is false', () => { | ||
props.hasGuestRole = false; | ||
|
||
const wrapper = shallow(<AddUserForm {...props} />); | ||
|
||
expect(wrapper.contains(<option value="guest" />)).to.be.false; | ||
}); | ||
|
||
it('includes an option for member if the hasMemberRole prop is true', () => { | ||
props.hasMemberRole = true; | ||
|
||
const wrapper = shallow(<AddUserForm {...props} />); | ||
|
||
expect(wrapper.contains(<option value="member" />)).to.be.true; | ||
}); | ||
|
||
it('does not include an option for member if the hasMemberRole prop is false', () => { | ||
props.hasMemberRole = false; | ||
|
||
const wrapper = shallow(<AddUserForm {...props} />); | ||
|
||
expect(wrapper.contains(<option value="member" />)).to.be.false; | ||
}); | ||
|
||
it('includes an option for owner if the hasOwnerRole prop is true', () => { | ||
props.hasOwnerRole = true; | ||
|
||
const wrapper = shallow(<AddUserForm {...props} />); | ||
|
||
expect(wrapper.contains(<option value="owner" />)).to.be.true; | ||
}); | ||
|
||
it('does not include an option for owner if the hasOwnerRole prop is false', () => { | ||
props.hasOwnerRole = false; | ||
|
||
const wrapper = shallow(<AddUserForm {...props} />); | ||
|
||
expect(wrapper.contains(<option value="owner" />)).to.be.false; | ||
}); | ||
}); | ||
|
||
describe('the HelpBlock for the AddUserForm', () => { | ||
const ownerHelpString = ' Owners can manage all user roles and manage overall team information.'; | ||
it('contains additional guidance for owners if the hasOwnerRole is true', () => { | ||
props.hasOwnerRole = true; | ||
|
||
const wrapper = shallow(<AddUserForm {...props} />); | ||
|
||
expect(wrapper.contains(ownerHelpString)).to.be.true; | ||
}); | ||
|
||
it('does not contain additional guidance for owners if the hasOwnerRole is false', () => { | ||
props.hasOwnerRole = false; | ||
|
||
const wrapper = shallow(<AddUserForm {...props} />); | ||
|
||
expect(wrapper.contains(ownerHelpString)).to.be.false; | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,7 @@ function action(context) { | |
</LayoutContainer> | ||
), | ||
title: 'Log in', | ||
ogTitle: 'Lunch' | ||
})); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.