summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)AuthorFilesLines
2024-04-24Inline the header svgEd Tanous1-0/+1
Ideally we wouldn't have to pull down this file on every load, and we could just inline it. This commit implements inlining. Note, that this requires a minor modification to the unit test, as the inline header remains when unit tests are run. It's not clear at this time how to make inlining plugin operate on unit tests, but it doesn't seem terribly important. Tested: Loading the webui no longer shows a download of logo-header Change-Id: Iaa5be5b5a84e0ad6e1f430113f929032835c9f1c Signed-off-by: Ed Tanous <ed@tanous.net>
2024-03-01Add empty authentication moduleEd Tanous1-1/+9
New versions of vuex warn if there are modules that are used in an element that haven't had their namespace defined. This module isn't actually used in the test, so add an empty Vuex module that matches the name of AuthenticationStore, so the test can pass. Change-Id: I5bceb3e1e0bad603028cfb17fa95b020d68ceb4d Signed-off-by: Ed Tanous <ed@tanous.net>
2024-02-29Correct AppNavigation snapshot to pass unit testsKonstantin Aladyshev1-0/+18
The commit "Add SNMP alerts page and test hooks" (7c1cfe7e25957fc915fc9790bdf78887295b1fee) has added a new page to the navigation, but didn't change the shanpshot. As a result this broke the unit tests. Perform "npx jest --updateSnapshot" to automatically correct the AppNavigation snapshot. Tested: Did npm run test:unit and it passed. Change-Id: I9f9dbf235013d8736d958d5c8d19eb3d75c575ba Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com> Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2023-03-27Added route restrictions based on user privilegeDamian Celico1-2/+11
This commit allows us to add 'exclusiveToRoles' field to route config files, with the list of roles that can access this resource, if needed. In this case, only Administrator can access Virtual-Media page and SOL console, and it is blocked for other users. Signed-off-by: Sivaprabu Ganesan <sivaprabug@ami.com> Change-Id: Ibcee18bd92d97c34414ecaf2caf6af28070c5538
2022-10-12Fix an undefined issue in UTwangqi021-0/+1
Change-Id: Id9bbacb752c142f712e4e5e752b74c5bac848d81 Signed-off-by: wangqi02 <wangqi02@inspur.com>
2022-02-04Add Key clear page under Operations sectionSandeepa Singh1-0/+18
This page will allow privileged user to clear encrypted keys. - Only admin and CE login user will be able to see the page - The UI will be different for both, admin and CE login user(service) - This page is IBM only Signed-off-by: Sandeepa Singh <sandeepa.singh@ibm.com> Change-Id: Ic6fe3454de815629a6b2250daa99ab21f2b316c3
2021-09-03Update login page layoutDerick Montague1-1/+1
This update will: - Change the positioning of the form to be on the left - Add the built on OpenBMC logo to the bottom right corner of the screen - Add the ability to include a GUI custom name using a .env variable. If the variable is not present, the login page will not include the <h1> section heading element. - Remove the word "logo" from the alt attribute for the company logo image used in the application header and on the login page. Github story: https://github.com/openbmc/webui-vue/issues/63 Signed-off-by: Derick Montague <derick.montague@ibm.com> Change-Id: I83ac5aecff0b3858c3ab5f38ab1aaa603d59acf1
2021-08-27Add system information on Appheader pageSukanya Pandey1-2/+2
- Model type and serial number are newly added system info data on Appheader. - On small screens and below system information(model type, serial number and asset tag) will be hidden. - On large screen and below model type and serial number will be visible but asset tag will be hidden. - For all other screens all the system info will be visible. Signed-off-by: Sukanya Pandey <sukapan1@in.ibm.com> Change-Id: Ia844a26f658083cbd5fa9c8f3f6bea8b65ddcd11
2021-08-10IA update: Add resource management sectionSandeepa Singh1-18/+156
This is the sixth commit for information architecture changes and has the following changes: - Resource management section has been added - Carbon icon used for resource management section is data--base--alt - Manage power usage page from operations has been moved to resource management - Manage power usage page has been updated to power page Signed-off-by: Sandeepa Singh <sandeepa.singh@ibm.com> Change-Id: If3feb994dbad19dd6cfb1507d976d09643c8e4d6
2021-08-10IA update: Update access and control sectionSandeepa Singh1-56/+52
This is the fifth commit of the information architecture changes and has the following changes: - The icon for access and control has been updated - Access and control section has been updated to security and access section - Security settings page has been updated to policies page and moved to security and access section - Client sessions page has been updated to sessions page - Local user management page has been updated to user management page - SSL certificates page has been updated to certificates page Signed-off-by: Sandeepa Singh <sandeepa.singh@ibm.com> Change-Id: Ie93cee9002742ecf7d33615636f4f159f4395fc4
2021-08-10IA update: Update configuration to settingsSandeepa Singh1-50/+32
This is the fourth update to information architecture changes and has the following changes: - The configuration section is updated to settings - The date and time settings page is updated to date and time - The network settings page is updated to network - The power restore policy page in operations section is moved to settings section Signed-off-by: Sandeepa Singh <sandeepa.singh@ibm.com> Change-Id: I6f5ab25f5227530be430bd39a4d9629b3bf09d8b
2021-08-10IA update: Update control section to operationsSandeepa Singh2-61/+43
This is the third update to the information architecture changes and has the following changes: - The control section has been updated to operations - The server led page has been removed - The firmware page is moved to operations section Signed-off-by: Sandeepa Singh <sandeepa.singh@ibm.com> Change-Id: I2e23da447890d7bee51892e1f782d5f2db6dded4
2021-08-10IA update: Update health sectionSandeepa Singh1-34/+34
This is the second update to information architecture changes and has the following changes: - Health section is updated to hardware status section - Hardware status page is updated to inventory and LEDs page - Route for sensors page has been updated Signed-off-by: Sandeepa Singh <sandeepa.singh@ibm.com> Change-Id: Ia1ba3a15a243a00f59a2ec646132436eb355a999
2021-08-10IA update: Add logs and update overview iconDerick Montague2-23/+161
This is the first patchset of the information architecture changes. These changes are the result of several months of design research with users to improve the existing information architecture (IA). More information can we found in the Github story. This patchset will add a Logs section and move event logs and dumps from the Health section to the new Logs section. It will also update the icon used for the Overview page. Github story: https://github.com/openbmc/webui-vue/issues/56 Testing: 1. IBM build: - Logs contained Event logs and dumps - Both pages rendered when clicking link 2. Intel build - Logs contained Event logs only - Logs page rendered when clicking link 3. Tested default build - Logs contained Event logs only - Logs page rendered when clicking link Signed-off-by: Derick Montague <derick.montague@ibm.com> Change-Id: I4621837202cf5ad3469d6ea460d9a5bdc79c8816
2021-07-22Update app nav test spec with post codesDixsie Wolmers1-0/+18
Ran NPM run test:update to update app nav test spec after post codes were merged. Signed-off-by: Dixsie Wolmers <dixsie@ibm.com> Change-Id: I4d168c80844a32732282a6f42d9cc9288463cf66
2021-05-18Replace use of the term host with serverDerick Montague1-3/+3
This patchset focuses on the global store use for server power operations and impacts several pages in the interface. For consistency, both in the UI and the code base, we are replacing the term host with server. This change impacts both the user and the developer experience. Maintaining consistency in naming allows both developers and users to form a mental model of the overall system and will help remove confusion when interacting with the UI and editing the interface. Testing: 1. Tested shutdown, power on, and reboot and verified the icons and page sections in the site header and the server power operations page update as expected during power operations. 2. Verified the one-time boot operations alert is displayed to the user when changing the boot settings on the server power operations page 3 Tested factory reset and validated the correct information message is displayed to the user with the server power off and on when performing the factory reset functions. 4. Verified the SOL Console status icon updates correctly during power operations. 5. Verified the alert message is displayed on the firmware update page when the server is powered on. Signed-off-by: Derick Montague <derick.montague@ibm.com> Change-Id: I88499a746364ab80f16a8b350d550407d094e95d
2021-03-30Update all minor and patch releasesDixsie2-7/+5
Updated NPM packages with minor and patch releases only. Tested the UI locally and by building copying to the BMC and running in an overlay and did not observe breaking changes. Major releases are not updated in this commit as they require additional testing and code updates to address breaking changes and will be updated separately once those updates are stable. Signed-off-by: Dixsie Wolmers <dixsie@ibm.com> Change-Id: I73c952a75a1148c5852a18d73b9065083fd8e94c
2021-03-09Add factory reset pageDerick Montague1-0/+18
This new page will be included in the Control section of the primary navigation. The user will be able to choose between two different reset actions. The user can make the following calls: - /redfish/v1/Systems/system/Bios/Actions/Bios.ResetBios - /redfish/v1/Managers/bmc/Actions/Manager.ResetToDefaults Signed-off-by: Derick Montague <derick.montague@ibm.com> Change-Id: I32a10dbce27a03fb84e24d7eae7c44eef9cffea5
2021-02-17Fix skip link 404 error on refresh bugDerick Montague1-1/+0
Problem: When a user uses the skip link anchor to skip the navigation, the route was being changed to /#main-content. This route does not exist. If a user were to manually refresh the page, it would return a 404. This link is critical to meet accessibility guidelines and is needed by users that navigate with a keyboard. The challenge is that we need to mirror a full page refresh on all route changes, so we set focus on the app-header element on each route change. When we click the skip to navigation link, there should not be a route change. All we need is to set focus on the <main> element so that the user can tab to the first tabbable element in the main content section. Solution: - Use a native <a> element with an attached click event handler - Prevent the default action of adding the hash to the URL - Create a global mixin to reuse for route changes and skip link activation - Emit an event that can be listened for to call the global mixin Signed-off-by: Derick Montague <derick.montague@ibm.com> Change-Id: I4c2301b02f608eeb376ed2d1bd809f3d5c1bf545
2021-02-02Add power restore policy pageSukanya Pandey1-0/+18
- This page will show how the system boots once power is restored after a power disturbance. - API used to fetch the JSON: /redfish/v1/JsonSchemas/ComputerSystem/ComputerSystem.json - API used to fetch the current policy and to save updated policy: /redfish/v1/Systems/system/ Signed-off-by: Sukanya Pandey <sukapan1@in.ibm.com> Change-Id: I203bd3c5d26071b882cce6b9950cdb3fb1deb212
2021-01-29Update failing unit testsYoshie Muranaka2-2/+12
Accessibility updates for icon only buttons required updates to snapshot unit tests. Signed-off-by: Yoshie Muranaka <yoshiemuranaka@gmail.com> Change-Id: Ia2bb1576f53d3f38c4c68879b5273edd3d33b92d
2021-01-20Add unit test cases for search componentSukanya Pandey2-0/+94
Signed-off-by: Sukanya Pandey <sukapan1@in.ibm.com> Change-Id: I9721a9bc8b1fce850b824a2f9d7a6d199c5e0236
2021-01-20Add unit test cases for loading bar componentSurenNeware2-0/+52
Signed-off-by: Suren Neware <sneware9@in.ibm.com> Change-Id: Ifcb488df080bd64ce9e9865befd4c044a73589e1
2021-01-20Run test script as part of the pre-commit hookDerick Montague2-0/+3
Now that we have added more unit testing, it will be beneficial to run the unit test script prior to check in. Eventually, we will want this to be part of the CI build process since Git pre-hooks can be avoided. Signed-off-by: Derick Montague <derick.montague@ibm.com> Change-Id: I59aad81a470176d2f6a5afeb130661c642f4d259
2021-01-12Fix broken TableToolbar snapshot testDerick Montague2-0/+7
Signed-off-by: Derick Montague <derick.montague@ibm.com> Change-Id: I37054cd6aabc619a001ced0d928aacd22f46ed3d
2021-01-12Fix broken info-tooltip spec and snapshotDerick Montague2-14/+25
- Two of the test are not needed since they are testing the vue internal functionality of rendering a title attribute value correctly and importing the right carbon icon. For this test the only tests needed is the snapshot. It could be debated that this component does not require a spec at all. Signed-off-by: Derick Montague <derick.montague@ibm.com> Change-Id: Icca107b185cd579d47877d50ec5763c5ffffc06a
2021-01-09Add unit test cases for table cell count componentSukanya Pandey2-0/+41
Signed-off-by: Sukanya Pandey <sukapan1@in.ibm.com> Change-Id: Id948347cd38a9e58d21aaf4180afe8ab5c2f2ed7
2021-01-08Resolve issue of page not found when opening new tabSukanya Pandey2-312/+160
Signed-off-by: Sukanya Pandey <sukapan1@in.ibm.com> Signed-off-by: Derick Montague <derick.montague@ibm.com> Change-Id: Id46f9f663c456a7d09b55d6d322b00785df4cbe7
2021-01-08Add unit test cases for status icon componentSukanya Pandey2-0/+65
Signed-off-by: Sukanya Pandey <sukapan1@in.ibm.com> Change-Id: I58bb3e5f5fa9c02276b2031322ac01affeb17ca3
2021-01-07Update PageContainer snapshot testDerick Montague1-5/+4
The UI is rendering differently than the snapshot saved. I reviewed the difference and it is simply a difference with how the formatting of the class and id values. I did not see this issue when testing the PageContainer snapshot test. It is not clear why there is a difference, but if it were to fail again for a different user, we can remove the snapshot since the main test we want to pass is that the HTML element being rendered is the <main> element. To update the snapshot for an individual spec file, use the following command in the cli: npm run test:update -- -u tests/unit/Global/PageContainer.spec.js Signed-off-by: Derick Montague <derick.montague@ibm.com> Change-Id: Ieac495f893ba2025d2d6f4d3b7b49506bdf0ecae
2021-01-07Add unit test cases for info tooltip componentSurenNeware2-0/+41
Signed-off-by: Suren Neware <sneware9@in.ibm.com> Change-Id: Ic89aed1f8244073eab82cdc6f79dba9520585374
2021-01-07Add unit test cases for table toolbar componentSukanya Pandey2-0/+58
Signed-off-by: Sukanya Pandey <sukapan1@in.ibm.com> Change-Id: I2e93244fcd8bbde7c9398cf0db56d5125614aa69
2021-01-07Add test case for input password toggle componentSukanya Pandey2-0/+65
Signed-off-by: Sukanya Pandey <sukapan1@in.ibm.com> Change-Id: I00e3fc12a58d644d0aad3c0caf4a94d2ed435109
2021-01-05Add unit test cases for page container componentSurenNeware2-0/+31
Signed-off-by: Suren Neware <sneware9@in.ibm.com> Change-Id: Ia7895156d1a4551bd70f95cc0207bf72522fba0e
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 Montague5-62/+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 Pandey2-12/+11
- 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>