Skip to content

Conversation

kaladay
Copy link
Contributor

@kaladay kaladay commented Dec 18, 2019

Make angularui tests in TAMUlib projects more consistent with each other and recent software coding style practices.

Notable changes:

  • Renaming of generated test messages to be easier to read.
  • Implementation of test generated tests for commonly used tests (mostly method existence tests).
  • Replaced 4-space tabbing with 2-space tabbing.
  • Updated utility tools to match other projects.
  • Updated mocks to most recent design practices.
  • Fixed missing dependencies, such as jasmine-promise-matchers.
  • Updated latest karma versions.
  • Made sure templates get processed via karma's ngHtml2JsPreprocessor setting and its respective module("templates").

The newer practices in the UI is to use 2-spaces instead of 4.
The Alert model is a weaver model, so make it the same across different projects.
Manually set the project specific channels in the desired tests.
Make sure models that could be used are available for mocking.
This was updated as a result of karma package version updates.
Remove duplicate includes.
Make ordering structure more similar to other projects so that they can be more easily compared.
The repo validations object is defined but no way was ever provided to assign some value to it.
Provide a `repo.mockValidations` method to give control over mocking the validations object associated with a given repo mock.
… and controller method exists

The preferred method would be to use a utility function that accepts a few parameters.
The problem with the preferred method is the underlying error reporting in karma does not show the full stack trace using this approach.

As a compromize, this implements the same process for every controller.
This still results in a size reduction of code by placing the differences in a single array.

The error reporting messages are also improved.
- Before: "Is the controller defined should be defined for admin"
- After: "Is the controller defined for ROLE_ADMIN"
- Before: "Are the scope methods defined update role should be defined"
- After: "Is the scope method updateRole defined"
I forgot to make these changes in the previous "Update repos" commit.
@kaladay kaladay requested a review from jsavell December 18, 2019 22:05
@coveralls
Copy link

coveralls commented Dec 18, 2019

Coverage Status

Coverage increased (+2.6%) to 82.796% when pulling d557fc1 on 2019_12-ui_test_improvements into 80b8277 on sprint12-staging.

…e guide test

This no-loop-function style guide test is not good advice, but it is simpler to go with it than to ignore it.
The resulting code is more confusing and complicated, but avoids the annoyance.
@kaladay kaladay requested review from a user, jcreel, jeremythuff and rladdusaw February 10, 2020 22:26
@ghost ghost merged commit 77886c0 into sprint12-staging Feb 20, 2020
@ghost ghost deleted the 2019_12-ui_test_improvements branch February 20, 2020 20:37
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants