summaryrefslogtreecommitdiff
path: root/tests/unit
AgeCommit message (Collapse)AuthorFilesLines
2021-01-05Add updated spec file for AppNavigation and AppHeader componentSukanya Pandey2-0/+59
Signed-off-by: Sukanya Pandey <sukapan1@in.ibm.com> Change-Id: I529fab5463692e70dea23536b7b0ca1ce52c67a7
2020-12-02Add unit testing for page title componentSukanya Pandey2-0/+48
Signed-off-by: Sukanya Pandey <sukapan1@in.ibm.com> Change-Id: I1fc54f54bd8e9a7d132eab0edaed94a4032143c8
2020-12-02Update application navigation component snapshotDerick Montague1-2/+2
- Ran npm test:update to update snapshot test to fix a broken test caused by the change to the snmp route update in https://gerrit.openbmc-project.xyz/c/openbmc/webui-vue/+/38207 Signed-off-by: Derick Montague <derick.montague@ibm.com> Change-Id: I3777026f9c61ed2009b7c36493c7ff7df8ecd629
2020-12-02Add unit testing for page section componentDerick Montague2-0/+37
Signed-off-by: Derick Montague <derick.montague@ibm.com> Signed-off-by: Sukanya Pandey <sukapan1@in.ibm.com> Change-Id: I1b3511f0dccaefb0732d5df3f21d10595f0fbd9a
2020-11-12Resolve custom-event-name-casing lint warningsSukanya Pandey2-8/+8
Signed-off-by: Sukanya Pandey <sukapan1@in.ibm.com> Change-Id: I9eea4eac3b8cacc216fc9ad1011e51622622e75f
2020-11-12Fix typo in spec descriptionDerick Montague1-1/+1
Signed-off-by: Derick Montague <derick.montague@ibm.com> Change-Id: Ib410eec180d8f08728aae5504ff412fa01df9fee
2020-11-10Update failing unit testsDerick Montague3-476/+582
- Add babel plugin to handle Jest import of SVG. Without plugin the test fails with a require.context() is undefined - Update snapshot tests that have changed - Removed globals from .eslintrc.js that were needed prior to migrating from Mocha and Chai to Jest Signed-off-by: Derick Montague <derick.montague@ibm.com> Change-Id: Ibd01d2e629b5ecb47d072e277e4e9b5ae5c5f001
2020-11-03Update linting packages to use latestDerick Montague2-5/+5
- 99% of changes were small syntax changes that were changed by the lint command. There were a couple of small manual changes to meet the property order patterns established as part of the vue:recommended guidelines. There are rules that were set from errors to warnings and new stories are being opened to address those issues. Testing: - Successfully ran npm run serve - Successfully ran npm run lint - Verified functionality works as expected, e.g. success and failure use cases - Resolved any JavaScript errors thrown to the console Signed-off-by: Derick Montague <derick.montague@ibm.com> Change-Id: Ie082f31c73ccbe8a60afa8f88a9ef6dbf33d9fd2
2020-09-30Resolve broken unit testsDerick Montague3-171/+320
- Refactor broke snapshots and the logout functionality test Signed-off-by: Derick Montague <derick.montague@ibm.com> Change-Id: I31932b0553a8ca9e6e2a38235b7769fab2061ba6
2020-05-05Use Jest as the test frameworkDerick Montague4-51/+1153
- Remove mocha, chai, sinon and setup.js - Add snapshot test to ApplicationHeader spec and remove skip nav link test - Add an update snapshot test that can be run if a page changes and the snapshot needs to be updated - Remove tight coupling of application structure and test in ApplicationHeader spec We are changing to Jest for a few reasons: 1. Jest is the testing framework used by most Vue applications and has robust documentation 2. It requires less configuration and works out of the box 3. It includes the ability to perform snapshot testing of rendered UI, which is much easier to maintain than trying to test specific UI elements. Signed-off-by: Derick Montague <derick.montague@ibm.com> Change-Id: I7bca3613991ebae1fd464fa3a60f079d044ed7b4
2020-04-09Resolve header and nav accessibility violationsDerick Montague1-37/+47
- Add aria-label to nav sections in app-header and app-nav to meet accessibility guidelines. When application has multiple nav elements an aria-label is required to help screen readers identify the elements - Remove b-nav child of b-nav-bar in app-header to fix invalid markup generated by Bootstrap-vue components. Components were not used as expected by the component library - Replace b-nav-item with HTML <li> elements using nav-item css classes in order to use button elements. Bootstrap-vue generates <a> elements which is not the semantic HTML element to use for items that are not links to other sections of the application. - Removed aria-expanded and nav-open class from nav-trigger button - Update appHeader unit test Used a TDD approach to write all tests to fail and then updated the methods and actions to make the tests suceed. Each test resulting in a dispatched action should be called once only and with the expected action. Signed-off-by: Derick Montague <derick.montague@ibm.com> Change-Id: I18af3727708526f814b7ceb77a0c28fda9f3d9bd
2020-04-07Add spec files for the componentsSukanya Pandey2-0/+99
- AppHeader.js - AppNavigation.js Signed-off-by: Sukanya Pandey <sukapan1@in.ibm.com> Change-Id: I55bbd16349dcf134b68fe33ba7cc26f29a98cfc7
2020-03-26Add mocha and chai test frameworkSukanya Pandey1-12/+0
- Mocha/Chai/Sinon test frameowrk because it has 100% feature parity with vue-loader. - Code for making 'expect' function accessible globally. Signed-off-by: Sukanya Pandey <sukapan1@in.ibm.com> Change-Id: Idf809cb08d8c1ef177ff92f0ee1be04ac74059a3
2020-01-27Add singlequote override and fix filesDerick Montague1-5/+5
Based on phosphor-webui and JavaScript common practices we are setting ESLint to required single quote for JS files and double quote for SCSS files. This commit adds the ESLint override to the prettier rules and runs the npm lint script that fixes the files that violate the rule. Signed-off-by: Derick Montague <derick.montague@ibm.com> Change-Id: I50cba77b2d0797595ce94258029608efa8665005
2020-01-21Create basic application using vueDerick Montague1-0/+12
- Create vue app - Add AppHeader and AppNavigation - Set up routes for server overview and local user management - Add themes and set to gray-10 theme - Add active class for current navigation - Add a prototype method named $http to vue prototype - The UI uses console logs in production to communicate to users - Add boostrap vue component library Change-Id: Ib6618e6357ca01bdac6de4ed031a15c8552226f3 Signed-off-by: Derick Montague <derick.montague@ibm.com>