├── .eslintrc.json ├── .gitignore ├── README.md ├── __tests__ ├── test_accordion.js ├── test_accordion_multi.js ├── test_box.js ├── test_box_info.js ├── test_box_negative.js ├── test_box_positive.js ├── test_box_warn.js ├── test_data_table.js ├── test_dropdown.js ├── test_fieldset.js ├── test_fieldset_info.js ├── test_fieldset_negative.js ├── test_fieldset_positive.js ├── test_fieldset_warn.js ├── test_form_button.js ├── test_form_button_examples.js ├── test_form_button_link.js ├── test_form_checkbox.js ├── test_form_checkbox_list.js ├── test_form_checkbox_list_inline.js ├── test_form_input.js ├── test_form_radio.js ├── test_form_radio_list.js ├── test_form_radio_list_inline.js ├── test_form_search.js ├── test_form_select.js ├── test_form_textarea.js ├── test_form_textdiv.js ├── test_image.js ├── test_image_figure.js ├── test_list_clean.js ├── test_list_inline.js ├── test_list_separator.js └── test_tabs.js ├── design_assets └── t7-icons.sketch ├── package.json ├── source ├── components │ ├── accordion │ │ ├── README.md │ │ ├── index.js │ │ ├── template_header.js │ │ └── template_panel.js │ ├── accordion_multi │ │ ├── README.md │ │ └── index.js │ ├── box │ │ ├── README.md │ │ └── index.js │ ├── box_info │ │ ├── README.md │ │ └── index.js │ ├── box_negative │ │ ├── README.md │ │ └── index.js │ ├── box_positive │ │ ├── README.md │ │ └── index.js │ ├── box_warn │ │ ├── README.md │ │ └── index.js │ ├── data_table │ │ ├── README.md │ │ ├── index.js │ │ ├── template_pagination.js │ │ ├── template_td.js │ │ ├── template_th.js │ │ └── template_tr.js │ ├── dropdown │ │ ├── README.md │ │ ├── index.js │ │ └── template_item.js │ ├── fieldset │ │ ├── README.md │ │ └── index.js │ ├── fieldset_info │ │ ├── README.md │ │ └── index.js │ ├── fieldset_negative │ │ ├── README.md │ │ └── index.js │ ├── fieldset_positive │ │ ├── README.md │ │ └── index.js │ ├── fieldset_warn │ │ ├── README.md │ │ └── index.js │ ├── form_button │ │ ├── README.md │ │ └── index.js │ ├── form_button_examples │ │ ├── README.md │ │ └── index.js │ ├── form_checkbox │ │ ├── README.md │ │ └── index.js │ ├── form_checkbox_list │ │ ├── README.md │ │ └── index.js │ ├── form_checkbox_list_inline │ │ ├── README.md │ │ └── index.js │ ├── form_input │ │ ├── README.md │ │ └── index.js │ ├── form_radio │ │ ├── README.md │ │ └── index.js │ ├── form_radio_list │ │ ├── README.md │ │ └── index.js │ ├── form_radio_list_inline │ │ ├── README.md │ │ └── index.js │ ├── form_search │ │ ├── README.md │ │ └── index.js │ ├── form_select │ │ ├── README.md │ │ └── index.js │ ├── form_textarea │ │ ├── README.md │ │ └── index.js │ ├── form_textdiv │ │ ├── README.md │ │ └── index.js │ ├── image │ │ ├── README.md │ │ └── index.js │ ├── image_figure │ │ ├── README.md │ │ └── index.js │ ├── list_clean │ │ ├── README.md │ │ └── index.js │ ├── list_inline │ │ ├── README.md │ │ └── index.js │ ├── list_separator │ │ ├── README.md │ │ └── index.js │ └── tabs │ │ ├── README.md │ │ ├── index.js │ │ ├── template_panel.js │ │ └── template_tab.js ├── components_misc │ └── markdown │ │ ├── code.js │ │ └── text.js ├── docs │ └── doc_404.md ├── fake │ ├── _accordion.js │ ├── _box.js │ ├── _data_table_cols.js │ ├── _data_table_rows.js │ ├── _list.js │ ├── _tabs.js │ └── index.js ├── index.html ├── index.js ├── layouts │ └── app │ │ ├── footer.js │ │ ├── header.js │ │ ├── index.js │ │ ├── main.js │ │ └── wrapper.js ├── pages │ ├── 404 │ │ └── index.js │ ├── accounts │ │ └── index.js │ └── profile │ │ ├── index.js │ │ └── states.json ├── redux │ ├── _types.js │ ├── actions │ │ ├── accounts_tabs_actions.js │ │ ├── checking_table_actions.js │ │ ├── faq_accordion_actions.js │ │ ├── profile_form_actions.js │ │ └── savings_table_actions.js │ ├── index.js │ └── reducers │ │ ├── accounts_tabs_reducer.js │ │ ├── checking_table_reducer.js │ │ ├── faq_accordion_reducer.js │ │ ├── profile_form_reducer.js │ │ └── savings_table_reducer.js ├── routes.js ├── sass │ ├── index.scss │ └── partials │ │ ├── _global.scss │ │ ├── _reset.scss │ │ ├── _t7-accordion.scss │ │ ├── _t7-app.scss │ │ ├── _t7-box.scss │ │ ├── _t7-data-table.scss │ │ ├── _t7-dropdown.scss │ │ ├── _t7-figure.scss │ │ ├── _t7-form.scss │ │ ├── _t7-helper.scss │ │ ├── _t7-list-clean.scss │ │ ├── _t7-list-inline.scss │ │ ├── _t7-list-separator.scss │ │ ├── _t7-search-table.scss │ │ └── _t7-tabs.scss ├── static │ ├── README.md │ ├── images │ │ ├── favicon.png │ │ ├── fpo │ │ │ ├── fpo_dock.jpg │ │ │ ├── fpo_jonathan_rogersonian.jpg │ │ │ ├── fpo_matterhorn.jpg │ │ │ ├── fpo_phone_booth.jpg │ │ │ └── fpo_phone_ocean.jpg │ │ ├── t7-app__header__logo.svg │ │ ├── t7-box--info--icon.svg │ │ ├── t7-box--negative--icon.svg │ │ ├── t7-box--positive--icon.svg │ │ ├── t7-box--warn--icon.svg │ │ ├── t7-box__close.svg │ │ ├── t7-data-table__th--sortable.svg │ │ ├── t7-data-table__th--sortable[asc].svg │ │ ├── t7-data-table__th--sortable[desc].svg │ │ ├── t7-dropdown__trigger.svg │ │ ├── t7-form__checkbox__fake.svg │ │ ├── t7-form__radio__fake.svg │ │ └── t7-form__select.svg │ └── json │ │ └── tree_diagram.json └── utils │ ├── _ajax.js │ ├── _bind.js │ ├── _convert_content_editable.js │ ├── _convert_content_focus.js │ ├── _convert_on_paste.js │ ├── _convert_to_markup.js │ ├── _convert_to_text.js │ ├── _exists.js │ ├── _get_data_by_name.js │ ├── _log.js │ ├── _markdown.js │ ├── _navigate.js │ ├── _parse_form_data.js │ ├── _path.js │ ├── _placeholder.js │ ├── _regex.js │ ├── _save.js │ ├── _stop.js │ ├── _storage.js │ ├── _title.js │ ├── _today.js │ ├── _trim.js │ ├── _unique.js │ └── index.js └── webpack.config.js /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "standard", 4 | "standard-react" 5 | ], 6 | "rules": { 7 | "no-console": [ 8 | "error", 9 | { 10 | "allow": [ 11 | "warn", 12 | "error" 13 | ] 14 | } 15 | ], 16 | "no-var": "error", 17 | "quote-props": [ 18 | "error", 19 | "as-needed" 20 | ] 21 | } 22 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | coverage 3 | node_modules 4 | npm-debug.log 5 | /sass-lint.html 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # T7 React Starter 2 | 3 | This is where we tinker with our approach to React projects. 4 | 5 | Note: Depending on how Node is set up on your machine, you may need to prefix the following commands with `sudo`. 6 | 7 | --- 8 | 9 | To get this project running… 10 | 11 | 1. Clone this repository. 12 | 2. `cd` into the local directory. 13 | 3. Type `npm install`. 14 | 4. Type `npm start`. 15 | 16 | It should then be viewable at… 17 | 18 | http://localhost:8080/ 19 | 20 | --- 21 | 22 | To run unit tests on the React components… 23 | 24 | 1. `cd` into the local directory. 25 | 2. Type `npm run test` 26 | 27 | After the tests run, assuming everything is successful, you can view reports related to JS and CSS here… 28 | 29 | * JS — `/coverage/lcov-report/index.html` 30 | * CSS — `/sass-lint.html` 31 | 32 | --- 33 | 34 | To build the starter app to static files… 35 | 36 | 1. `cd` into the local directory. 37 | 2. Type `npm start`. 38 | 3. Type `npm run build`. -------------------------------------------------------------------------------- /__tests__/test_accordion.js: -------------------------------------------------------------------------------- 1 | /*global 2 | describe 3 | expect 4 | it 5 | jest 6 | */ 7 | 8 | jest.disableAutomock() 9 | 10 | // Dependencies. 11 | import React from 'react' 12 | import T from 'react-addons-test-utils' 13 | 14 | // UI components. 15 | import Accordion from '../source/components/accordion' 16 | import AccordionPanel from '../source/components/accordion/template_panel' 17 | 18 | // Describe `` name. 19 | describe('Accordion', function () { 20 | // First panel selected. 21 | const selected = { 22 | 0: true 23 | } 24 | 25 | // Insert the component into DOM. 26 | const el = T.renderIntoDocument( 27 | 28 | 29 |

30 | Content for "Item 1" 31 |

32 |
33 | 34 |

35 | Content for "Item 2" 36 |

37 |
38 |
39 | ) 40 | 41 | // Get parent element. 42 | const parent = T.findRenderedDOMComponentWithClass(el, 't7-accordion') 43 | 44 | // Get headers and panels. 45 | const headers = parent.querySelectorAll('dt') 46 | const panels = parent.querySelectorAll('dd') 47 | 48 | // =================== 49 | // Test for existence. 50 | // =================== 51 | 52 | it('exists in the page', function () { 53 | expect(T.isCompositeComponent(el)).toBe(true) 54 | }) 55 | 56 | // ================= 57 | // Test for headers. 58 | // ================= 59 | 60 | it('has child headers', function () { 61 | expect(headers.length).toBe(2) 62 | }) 63 | 64 | // ================ 65 | // Test for panels. 66 | // ================ 67 | 68 | it('has child panels', function () { 69 | expect(panels.length).toBe(2) 70 | }) 71 | 72 | // ================ 73 | // Test for events. 74 | // ================ 75 | 76 | it('responds to clicks', function () { 77 | T.Simulate.click(headers[1]) 78 | 79 | // First panel = off. 80 | expect(headers[0].getAttribute('aria-selected')).toBe('false') 81 | expect(panels[0].getAttribute('aria-hidden')).toBe('true') 82 | 83 | // Second panel = on. 84 | expect(headers[1].getAttribute('aria-selected')).toBe('true') 85 | expect(panels[1].getAttribute('aria-hidden')).toBe('false') 86 | }) 87 | }) 88 | -------------------------------------------------------------------------------- /__tests__/test_accordion_multi.js: -------------------------------------------------------------------------------- 1 | /*global 2 | describe 3 | expect 4 | it 5 | jest 6 | */ 7 | 8 | jest.disableAutomock() 9 | 10 | // Dependencies. 11 | import React from 'react' 12 | import T from 'react-addons-test-utils' 13 | 14 | // UI components. 15 | import AccordionMulti from '../source/components/accordion_multi' 16 | import AccordionPanel from '../source/components/accordion/template_panel' 17 | 18 | // Describe `` name. 19 | describe('AccordionMulti', function () { 20 | // Insert the component into DOM. 21 | const el = T.renderIntoDocument( 22 | 23 | 24 |

25 | Content for "Item 1" 26 |

27 |
28 | 29 |

30 | Content for "Item 2" 31 |

32 |
33 |
34 | ) 35 | 36 | // Get parent element. 37 | const parent = T.findRenderedDOMComponentWithClass(el, 't7-accordion') 38 | 39 | // Get headers and panels. 40 | const headers = parent.querySelectorAll('dt') 41 | const panels = parent.querySelectorAll('dd') 42 | 43 | // =================== 44 | // Test for existence. 45 | // =================== 46 | 47 | it('exists in the page', function () { 48 | expect(T.isCompositeComponent(el)).toBe(true) 49 | }) 50 | 51 | // ================= 52 | // Test for headers. 53 | // ================= 54 | 55 | it('has child headers', function () { 56 | expect(headers.length).toBe(2) 57 | }) 58 | 59 | // ================ 60 | // Test for panels. 61 | // ================ 62 | 63 | it('has child panels', function () { 64 | expect(panels.length).toBe(2) 65 | }) 66 | 67 | // ================ 68 | // Test for events. 69 | // ================ 70 | 71 | it('responds to clicks', function () { 72 | T.Simulate.click(headers[0]) 73 | T.Simulate.click(headers[1]) 74 | 75 | // First panel = on. 76 | expect(headers[0].getAttribute('aria-selected')).toBe('true') 77 | expect(panels[0].getAttribute('aria-hidden')).toBe('false') 78 | 79 | // Second panel = on. 80 | expect(headers[1].getAttribute('aria-selected')).toBe('true') 81 | expect(panels[1].getAttribute('aria-hidden')).toBe('false') 82 | }) 83 | }) 84 | -------------------------------------------------------------------------------- /__tests__/test_box.js: -------------------------------------------------------------------------------- 1 | /*global 2 | describe 3 | expect 4 | it 5 | jest 6 | */ 7 | 8 | jest.disableAutomock() 9 | 10 | // Dependencies. 11 | import React from 'react' 12 | import T from 'react-addons-test-utils' 13 | 14 | // UI components. 15 | import Box from '../source/components/box' 16 | 17 | // Describe `` name. 18 | describe('Box', function () { 19 | // Insert the component into DOM. 20 | const el = T.renderIntoDocument( 21 | 22 |

23 | Lorem ipsum dolor sit amet. 24 |

25 |

26 | Lorem ipsum dolor sit amet. 27 |

28 |
29 | ) 30 | 31 | // Get parent element. 32 | const parent = T.findRenderedDOMComponentWithClass(el, 't7-box') 33 | 34 | // Get content. 35 | const content = parent.querySelectorAll('p') 36 | 37 | // =================== 38 | // Test for existence. 39 | // =================== 40 | 41 | it('exists in the page', function () { 42 | expect(T.isCompositeComponent(el)).toBe(true) 43 | }) 44 | 45 | // ================= 46 | // Test for content. 47 | // ================= 48 | 49 | it('has content', function () { 50 | expect(content.length).toBe(2) 51 | }) 52 | }) 53 | -------------------------------------------------------------------------------- /__tests__/test_box_info.js: -------------------------------------------------------------------------------- 1 | /*global 2 | describe 3 | expect 4 | it 5 | jest 6 | */ 7 | 8 | jest.disableAutomock() 9 | 10 | // Dependencies. 11 | import React from 'react' 12 | import T from 'react-addons-test-utils' 13 | 14 | // UI components. 15 | import BoxInfo from '../source/components/box_info' 16 | 17 | // Describe `` name. 18 | describe('BoxInfo', function () { 19 | // Insert the component into DOM. 20 | const el = T.renderIntoDocument( 21 | 22 |

23 | Lorem ipsum dolor sit amet. 24 |

25 |

26 | Lorem ipsum dolor sit amet. 27 |

28 |
29 | ) 30 | 31 | // Get parent element. 32 | const parent = T.findRenderedDOMComponentWithClass(el, 't7-box--info') 33 | 34 | // Get content. 35 | const content = parent.querySelectorAll('p') 36 | 37 | // Get close link. 38 | const close = parent.querySelector('.t7-box__close') 39 | 40 | // =================== 41 | // Test for existence. 42 | // =================== 43 | 44 | it('exists in the page', function () { 45 | expect(T.isCompositeComponent(el)).toBe(true) 46 | }) 47 | 48 | // ================= 49 | // Test for content. 50 | // ================= 51 | 52 | it('has content', function () { 53 | expect(content.length).toBe(2) 54 | }) 55 | 56 | // =============== 57 | // Test for close. 58 | // =============== 59 | 60 | it('responds to close', function () { 61 | T.Simulate.click(close) 62 | 63 | // Box should be hidden. 64 | expect(parent.getAttribute('aria-hidden')).toBe('true') 65 | }) 66 | }) 67 | -------------------------------------------------------------------------------- /__tests__/test_box_negative.js: -------------------------------------------------------------------------------- 1 | /*global 2 | describe 3 | expect 4 | it 5 | jest 6 | */ 7 | 8 | jest.disableAutomock() 9 | 10 | // Dependencies. 11 | import React from 'react' 12 | import T from 'react-addons-test-utils' 13 | 14 | // UI components. 15 | import BoxInfo from '../source/components/box_negative' 16 | 17 | // Describe `` name. 18 | describe('BoxNegative', function () { 19 | // Insert the component into DOM. 20 | const el = T.renderIntoDocument( 21 | 22 |

23 | Lorem ipsum dolor sit amet. 24 |

25 |

26 | Lorem ipsum dolor sit amet. 27 |

28 |
29 | ) 30 | 31 | // Get parent element. 32 | const parent = T.findRenderedDOMComponentWithClass(el, 't7-box--negative') 33 | 34 | // Get content. 35 | const content = parent.querySelectorAll('p') 36 | 37 | // Get close link. 38 | const close = parent.querySelector('.t7-box__close') 39 | 40 | // =================== 41 | // Test for existence. 42 | // =================== 43 | 44 | it('exists in the page', function () { 45 | expect(T.isCompositeComponent(el)).toBe(true) 46 | }) 47 | 48 | // ================= 49 | // Test for content. 50 | // ================= 51 | 52 | it('has content', function () { 53 | expect(content.length).toBe(2) 54 | }) 55 | 56 | // =============== 57 | // Test for close. 58 | // =============== 59 | 60 | it('responds to close', function () { 61 | T.Simulate.click(close) 62 | 63 | // Box should be hidden. 64 | expect(parent.getAttribute('aria-hidden')).toBe('true') 65 | }) 66 | }) 67 | -------------------------------------------------------------------------------- /__tests__/test_box_positive.js: -------------------------------------------------------------------------------- 1 | /*global 2 | describe 3 | expect 4 | it 5 | jest 6 | */ 7 | 8 | jest.disableAutomock() 9 | 10 | // Dependencies. 11 | import React from 'react' 12 | import T from 'react-addons-test-utils' 13 | 14 | // UI components. 15 | import BoxPositive from '../source/components/box_positive' 16 | 17 | // Describe `` name. 18 | describe('BoxPositive', function () { 19 | // Insert the component into DOM. 20 | const el = T.renderIntoDocument( 21 | 22 |

23 | Lorem ipsum dolor sit amet. 24 |

25 |

26 | Lorem ipsum dolor sit amet. 27 |

28 |
29 | ) 30 | 31 | // Get parent element. 32 | const parent = T.findRenderedDOMComponentWithClass(el, 't7-box--positive') 33 | 34 | // Get content. 35 | const content = parent.querySelectorAll('p') 36 | 37 | // Get close link. 38 | const close = parent.querySelector('.t7-box__close') 39 | 40 | // =================== 41 | // Test for existence. 42 | // =================== 43 | 44 | it('exists in the page', function () { 45 | expect(T.isCompositeComponent(el)).toBe(true) 46 | }) 47 | 48 | // ================= 49 | // Test for content. 50 | // ================= 51 | 52 | it('has content', function () { 53 | expect(content.length).toBe(2) 54 | }) 55 | 56 | // =============== 57 | // Test for close. 58 | // =============== 59 | 60 | it('responds to close', function () { 61 | T.Simulate.click(close) 62 | 63 | // Box should be hidden. 64 | expect(parent.getAttribute('aria-hidden')).toBe('true') 65 | }) 66 | }) 67 | -------------------------------------------------------------------------------- /__tests__/test_box_warn.js: -------------------------------------------------------------------------------- 1 | /*global 2 | describe 3 | expect 4 | it 5 | jest 6 | */ 7 | 8 | jest.disableAutomock() 9 | 10 | // Dependencies. 11 | import React from 'react' 12 | import T from 'react-addons-test-utils' 13 | 14 | // UI components. 15 | import BoxWarn from '../source/components/box_warn' 16 | 17 | // Describe `` name. 18 | describe('BoxWarn', function () { 19 | // Insert the component into DOM. 20 | const el = T.renderIntoDocument( 21 | 22 |

23 | Lorem ipsum dolor sit amet. 24 |

25 |

26 | Lorem ipsum dolor sit amet. 27 |

28 |
29 | ) 30 | 31 | // Get parent element. 32 | const parent = T.findRenderedDOMComponentWithClass(el, 't7-box--warn') 33 | 34 | // Get content. 35 | const content = parent.querySelectorAll('p') 36 | 37 | // Get close link. 38 | const close = parent.querySelector('.t7-box__close') 39 | 40 | // =================== 41 | // Test for existence. 42 | // =================== 43 | 44 | it('exists in the page', function () { 45 | expect(T.isCompositeComponent(el)).toBe(true) 46 | }) 47 | 48 | // ================= 49 | // Test for content. 50 | // ================= 51 | 52 | it('has content', function () { 53 | expect(content.length).toBe(2) 54 | }) 55 | 56 | // =============== 57 | // Test for close. 58 | // =============== 59 | 60 | it('responds to close', function () { 61 | T.Simulate.click(close) 62 | 63 | // Box should be hidden. 64 | expect(parent.getAttribute('aria-hidden')).toBe('true') 65 | }) 66 | }) 67 | -------------------------------------------------------------------------------- /__tests__/test_dropdown.js: -------------------------------------------------------------------------------- 1 | /*global 2 | describe 3 | expect 4 | it 5 | jest 6 | */ 7 | 8 | jest.disableAutomock() 9 | 10 | // Dependencies. 11 | import React from 'react' 12 | import T from 'react-addons-test-utils' 13 | 14 | // UI components. 15 | import Dropdown from '../source/components/dropdown' 16 | 17 | // Describe `` name. 18 | describe('Dropdown', function () { 19 | // Insert the component into DOM. 20 | const el = T.renderIntoDocument( 21 | 35 | ) 36 | 37 | // Get parent element. 38 | const parent = T.findRenderedDOMComponentWithClass(el, 't7-dropdown') 39 | 40 | // Get dropdown children. 41 | const trigger = parent.querySelector('.t7-dropdown__trigger') 42 | const menu = parent.querySelector('.t7-dropdown__menu') 43 | const links = menu.querySelectorAll('.t7-dropdown__menu__link') 44 | 45 | // =================== 46 | // Test for existence. 47 | // =================== 48 | 49 | it('exists in the page', function () { 50 | expect(T.isCompositeComponent(el)).toBe(true) 51 | }) 52 | 53 | // ============================ 54 | // Test for toggle open/closed. 55 | // ============================ 56 | 57 | it('responds to toggle', function () { 58 | expect(menu.getAttribute('aria-hidden')).toBe('true') 59 | 60 | T.Simulate.click(trigger) 61 | 62 | expect(menu.getAttribute('aria-hidden')).toBe('false') 63 | }) 64 | 65 | // =============== 66 | // Test for links. 67 | // =============== 68 | 69 | it('has correct links', function () { 70 | expect(links.length).toBe(2) 71 | 72 | expect(links[0].href).toMatch('example.com') 73 | expect(links[1].href).toMatch('example.net') 74 | }) 75 | }) 76 | -------------------------------------------------------------------------------- /__tests__/test_fieldset.js: -------------------------------------------------------------------------------- 1 | /*global 2 | describe 3 | expect 4 | it 5 | jest 6 | */ 7 | 8 | jest.disableAutomock() 9 | 10 | // Dependencies. 11 | import React from 'react' 12 | import T from 'react-addons-test-utils' 13 | 14 | // UI components. 15 | import Fieldset from '../source/components/fieldset' 16 | 17 | // Describe `` name. 18 | describe('Fieldset', function () { 19 | // Insert the component into DOM. 20 | const el = T.renderIntoDocument( 21 |
22 |

23 | Lorem ipsum dolor sit amet. 24 |

25 |

26 | Lorem ipsum dolor sit amet. 27 |

28 |
29 | ) 30 | 31 | // Get parent element. 32 | const parent = T.findRenderedDOMComponentWithClass(el, 't7-box') 33 | 34 | // Get content. 35 | const content = parent.querySelectorAll('p') 36 | 37 | // Get legend. 38 | const legend = parent.querySelectorAll('legend') 39 | 40 | // =================== 41 | // Test for existence. 42 | // =================== 43 | 44 | it('exists in the page', function () { 45 | expect(T.isCompositeComponent(el)).toBe(true) 46 | }) 47 | 48 | // ================== 49 | // Test for fieldset. 50 | // ================== 51 | 52 | it('uses a fieldset tag', function () { 53 | const tag = parent.tagName.toLowerCase() 54 | 55 | expect(tag).toBe('fieldset') 56 | }) 57 | 58 | // ================ 59 | // Test for legend. 60 | // ================ 61 | 62 | it('has a legend', function () { 63 | expect(legend.length).toBe(1) 64 | }) 65 | 66 | // ================= 67 | // Test for content. 68 | // ================= 69 | 70 | it('has content', function () { 71 | expect(content.length).toBe(2) 72 | }) 73 | }) 74 | -------------------------------------------------------------------------------- /__tests__/test_fieldset_info.js: -------------------------------------------------------------------------------- 1 | /*global 2 | describe 3 | expect 4 | it 5 | jest 6 | */ 7 | 8 | jest.disableAutomock() 9 | 10 | // Dependencies. 11 | import React from 'react' 12 | import T from 'react-addons-test-utils' 13 | 14 | // UI components. 15 | import FieldsetInfo from '../source/components/fieldset_info' 16 | 17 | // Describe `` name. 18 | describe('FieldsetInfo', function () { 19 | // Insert the component into DOM. 20 | const el = T.renderIntoDocument( 21 | 22 |

23 | Lorem ipsum dolor sit amet. 24 |

25 |

26 | Lorem ipsum dolor sit amet. 27 |

28 |
29 | ) 30 | 31 | // Get parent element. 32 | const parent = T.findRenderedDOMComponentWithClass(el, 't7-box--info') 33 | 34 | // Get content. 35 | const content = parent.querySelectorAll('p') 36 | 37 | // Get legend. 38 | const legend = parent.querySelectorAll('legend') 39 | 40 | // =================== 41 | // Test for existence. 42 | // =================== 43 | 44 | it('exists in the page', function () { 45 | expect(T.isCompositeComponent(el)).toBe(true) 46 | }) 47 | 48 | // ================== 49 | // Test for fieldset. 50 | // ================== 51 | 52 | it('uses a fieldset tag', function () { 53 | const tag = parent.tagName.toLowerCase() 54 | 55 | expect(tag).toBe('fieldset') 56 | }) 57 | 58 | // ================ 59 | // Test for legend. 60 | // ================ 61 | 62 | it('has a legend', function () { 63 | expect(legend.length).toBe(1) 64 | }) 65 | 66 | // ================= 67 | // Test for content. 68 | // ================= 69 | 70 | it('has content', function () { 71 | expect(content.length).toBe(2) 72 | }) 73 | }) 74 | -------------------------------------------------------------------------------- /__tests__/test_fieldset_negative.js: -------------------------------------------------------------------------------- 1 | /*global 2 | describe 3 | expect 4 | it 5 | jest 6 | */ 7 | 8 | jest.disableAutomock() 9 | 10 | // Dependencies. 11 | import React from 'react' 12 | import T from 'react-addons-test-utils' 13 | 14 | // UI components. 15 | import FieldsetNegative from '../source/components/fieldset_negative' 16 | 17 | // Describe `` name. 18 | describe('FieldsetNegative', function () { 19 | // Insert the component into DOM. 20 | const el = T.renderIntoDocument( 21 | 22 |

23 | Lorem ipsum dolor sit amet. 24 |

25 |

26 | Lorem ipsum dolor sit amet. 27 |

28 |
29 | ) 30 | 31 | // Get parent element. 32 | const parent = T.findRenderedDOMComponentWithClass(el, 't7-box--negative') 33 | 34 | // Get content. 35 | const content = parent.querySelectorAll('p') 36 | 37 | // Get legend. 38 | const legend = parent.querySelectorAll('legend') 39 | 40 | // =================== 41 | // Test for existence. 42 | // =================== 43 | 44 | it('exists in the page', function () { 45 | expect(T.isCompositeComponent(el)).toBe(true) 46 | }) 47 | 48 | // ================== 49 | // Test for fieldset. 50 | // ================== 51 | 52 | it('uses a fieldset tag', function () { 53 | const tag = parent.tagName.toLowerCase() 54 | 55 | expect(tag).toBe('fieldset') 56 | }) 57 | 58 | // ================ 59 | // Test for legend. 60 | // ================ 61 | 62 | it('has a legend', function () { 63 | expect(legend.length).toBe(1) 64 | }) 65 | 66 | // ================= 67 | // Test for content. 68 | // ================= 69 | 70 | it('has content', function () { 71 | expect(content.length).toBe(2) 72 | }) 73 | }) 74 | -------------------------------------------------------------------------------- /__tests__/test_fieldset_positive.js: -------------------------------------------------------------------------------- 1 | /*global 2 | describe 3 | expect 4 | it 5 | jest 6 | */ 7 | 8 | jest.disableAutomock() 9 | 10 | // Dependencies. 11 | import React from 'react' 12 | import T from 'react-addons-test-utils' 13 | 14 | // UI components. 15 | import FieldsetPositive from '../source/components/fieldset_positive' 16 | 17 | // Describe `` name. 18 | describe('FieldsetPositive', function () { 19 | // Insert the component into DOM. 20 | const el = T.renderIntoDocument( 21 | 22 |

23 | Lorem ipsum dolor sit amet. 24 |

25 |

26 | Lorem ipsum dolor sit amet. 27 |

28 |
29 | ) 30 | 31 | // Get parent element. 32 | const parent = T.findRenderedDOMComponentWithClass(el, 't7-box--positive') 33 | 34 | // Get content. 35 | const content = parent.querySelectorAll('p') 36 | 37 | // Get legend. 38 | const legend = parent.querySelectorAll('legend') 39 | 40 | // =================== 41 | // Test for existence. 42 | // =================== 43 | 44 | it('exists in the page', function () { 45 | expect(T.isCompositeComponent(el)).toBe(true) 46 | }) 47 | 48 | // ================== 49 | // Test for fieldset. 50 | // ================== 51 | 52 | it('uses a fieldset tag', function () { 53 | const tag = parent.tagName.toLowerCase() 54 | 55 | expect(tag).toBe('fieldset') 56 | }) 57 | 58 | // ================ 59 | // Test for legend. 60 | // ================ 61 | 62 | it('has a legend', function () { 63 | expect(legend.length).toBe(1) 64 | }) 65 | 66 | // ================= 67 | // Test for content. 68 | // ================= 69 | 70 | it('has content', function () { 71 | expect(content.length).toBe(2) 72 | }) 73 | }) 74 | -------------------------------------------------------------------------------- /__tests__/test_fieldset_warn.js: -------------------------------------------------------------------------------- 1 | /*global 2 | describe 3 | expect 4 | it 5 | jest 6 | */ 7 | 8 | jest.disableAutomock() 9 | 10 | // Dependencies. 11 | import React from 'react' 12 | import T from 'react-addons-test-utils' 13 | 14 | // UI components. 15 | import FieldsetWarn from '../source/components/fieldset_warn' 16 | 17 | // Describe `` name. 18 | describe('FieldsetWarn', function () { 19 | // Insert the component into DOM. 20 | const el = T.renderIntoDocument( 21 | 22 |

23 | Lorem ipsum dolor sit amet. 24 |

25 |

26 | Lorem ipsum dolor sit amet. 27 |

28 |
29 | ) 30 | 31 | // Get parent element. 32 | const parent = T.findRenderedDOMComponentWithClass(el, 't7-box--warn') 33 | 34 | // Get content. 35 | const content = parent.querySelectorAll('p') 36 | 37 | // Get legend. 38 | const legend = parent.querySelectorAll('legend') 39 | 40 | // =================== 41 | // Test for existence. 42 | // =================== 43 | 44 | it('exists in the page', function () { 45 | expect(T.isCompositeComponent(el)).toBe(true) 46 | }) 47 | 48 | // ================== 49 | // Test for fieldset. 50 | // ================== 51 | 52 | it('uses a fieldset tag', function () { 53 | const tag = parent.tagName.toLowerCase() 54 | 55 | expect(tag).toBe('fieldset') 56 | }) 57 | 58 | // ================ 59 | // Test for legend. 60 | // ================ 61 | 62 | it('has a legend', function () { 63 | expect(legend.length).toBe(1) 64 | }) 65 | 66 | // ================= 67 | // Test for content. 68 | // ================= 69 | 70 | it('has content', function () { 71 | expect(content.length).toBe(2) 72 | }) 73 | }) 74 | -------------------------------------------------------------------------------- /__tests__/test_form_button.js: -------------------------------------------------------------------------------- 1 | /*global 2 | describe 3 | expect 4 | it 5 | jest 6 | */ 7 | 8 | jest.disableAutomock() 9 | 10 | // Dependencies. 11 | import React from 'react' 12 | import T from 'react-addons-test-utils' 13 | 14 | // UI components. 15 | import Button from '../source/components/form_button' 16 | 17 | // Describe `` name. 18 | describe('Button', function () { 19 | const ariaControls = 'example_id' 20 | const disabled = true 21 | const text = 'GO' 22 | const title = 'Example Title' 23 | const type = 'submit' 24 | 25 | // Insert the component into DOM. 26 | const el = T.renderIntoDocument( 27 |