Page MenuHomePhabricator

Backfill coverage for front-end tests
Open, LowPublic

Description

We should add more tests to the front-end.

Coverage as of 2023-06-02:

--------------------------------------------------------|---------|----------|---------|---------|-----------------------
File                                                    | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
--------------------------------------------------------|---------|----------|---------|---------|-----------------------
All files                                               |   82.05 |    74.72 |   85.13 |   82.05 |
 ext.wikilambda.edit                                    |   87.17 |      100 |       0 |   87.17 |
  Constants.js                                          |     100 |      100 |     100 |     100 |
  index.js                                              |       0 |      100 |       0 |       0 | 9-15
 ext.wikilambda.edit/components                         |    61.9 |    55.73 |   73.46 |    61.9 |
  App.vue                                               |   77.27 |       50 |   66.66 |   77.27 | 97-106
  ZObjectJson.vue                                       |    67.5 |     62.5 |   76.92 |    67.5 | 37,90,95,120-141
  ZObjectSelector.vue                                   |    56.6 |     55.1 |   73.33 |    56.6 | ...91,503,530-540,551
 ext.wikilambda.edit/components/base                    |   83.63 |    68.75 |   77.77 |   83.63 |
  ContextMenu.vue                                       |   64.28 |      100 |   33.33 |   64.28 | 54,62-63,82-85
  TextInput.vue                                         |   89.74 |    68.75 |     100 |   89.74 | 127,138,203-204
  WidgetBase.vue                                        |     100 |      100 |     100 |     100 |
 ext.wikilambda.edit/components/default-view-types      |   85.68 |    74.28 |    86.3 |   85.68 |
  ZBoolean.vue                                          |     100 |      100 |     100 |     100 |
  ZCode.vue                                             |      78 |    47.36 |   82.35 |      78 | 171-172,202-231,280
  ZEvaluationResult.vue                                 |   67.56 |       75 |      60 |   67.56 | 210-282
  ZFunctionCall.vue                                     |     100 |      100 |     100 |     100 |
  ZImplementation.vue                                   |   88.23 |    66.66 |    90.9 |   88.23 | 131-132
  ZMonolingualString.vue                                |     100 |       50 |     100 |     100 | 118
  ZObjectKeyValue.vue                                   |   82.11 |    74.16 |   84.61 |   82.11 | ...66-671,680,704-723
  ZObjectKeyValueSet.vue                                |     100 |      100 |     100 |     100 |
  ZObjectToString.vue                                   |     100 |    90.47 |     100 |     100 | 155,194
  ZObjectType.vue                                       |     100 |      100 |     100 |     100 |
  ZReference.vue                                        |     100 |    66.66 |     100 |     100 | 86-105
  ZString.vue                                           |     100 |      100 |     100 |     100 |
  ZTester.vue                                           |     100 |       50 |     100 |     100 | 73-93
  ZTypedList.vue                                        |   81.81 |       60 |    90.9 |   81.81 | 180,186-188
  ZTypedListItem.vue                                    |   88.88 |      100 |      75 |   88.88 | 93
  ZTypedListType.vue                                    |   78.57 |      100 |   66.66 |   78.57 | 72-83
 ext.wikilambda.edit/components/function                |   85.71 |       75 |   81.81 |   85.71 |
  ZFunctionTesterTable.vue                              |   85.71 |       75 |   81.81 |   85.71 | 79,129-139
 ext.wikilambda.edit/components/function/editor         |   91.07 |    83.33 |   88.13 |   90.96 |
  FunctionEditorAliases.vue                             |   91.83 |      100 |   93.33 |   91.66 | 195-201
  FunctionEditorDefinition.vue                          |   90.09 |     87.5 |    92.3 |      90 | ...81-386,434,438,454
  FunctionEditorFooter.vue                              |     100 |      100 |     100 |     100 |
  FunctionEditorInputs.vue                              |   96.15 |    83.33 |   93.33 |   96.15 | 201
  FunctionEditorInputsItem.vue                          |   86.36 |       60 |   72.22 |   86.15 | ...44,290,305-313,326
  FunctionEditorLanguage.vue                            |   90.47 |    83.33 |      80 |   90.24 | 76,94-95,168
  FunctionEditorName.vue                                |   95.83 |      100 |   88.88 |   95.83 | 75
  FunctionEditorOutput.vue                              |     100 |      100 |     100 |     100 |
 ext.wikilambda.edit/components/function/viewer         |   93.24 |    96.61 |   86.88 |   93.19 |
  FunctionViewerAbout.vue                               |     100 |      100 |     100 |     100 |
  FunctionViewerDetails.vue                             |   92.12 |    96.42 |   85.45 |   92.06 | ...46,460,476,492,514
  FunctionViewerSidebar.vue                             |     100 |      100 |     100 |     100 |
 ext.wikilambda.edit/components/function/viewer/about   |   94.89 |    79.31 |   96.55 |   94.89 |
  FunctionViewerAboutAliases.vue                        |     100 |      100 |     100 |     100 |
  FunctionViewerAboutDetails.vue                        |     100 |      100 |     100 |     100 |
  FunctionViewerAboutExamples.vue                       |    90.9 |       60 |     100 |    90.9 | 61
  FunctionViewerAboutNames.vue                          |   86.66 |    55.55 |   88.88 |   86.66 | 54,105,111,117
 ext.wikilambda.edit/components/function/viewer/details |   75.89 |    67.85 |   68.57 |   75.89 |
  FunctionViewerDetailsSidebar.vue                      |   76.54 |    67.85 |      75 |   76.54 | ...78,396-402,423,429
  FunctionViewerDetailsTable.vue                        |   86.66 |      100 |   71.42 |   86.66 | 139-142
  ZMetadataDialog.vue                                   |    62.5 |      100 |      25 |    62.5 | 95-106
 ext.wikilambda.edit/components/widgets                 |   73.47 |    58.99 |   77.84 |   73.47 |
  About.vue                                             |     100 |    55.55 |     100 |     100 | 230-316
  AboutEditMetadataDialog.vue                           |   70.37 |    58.62 |   82.85 |   70.37 | ...00,515-518,539-579
  AboutViewLanguagesDialog.vue                          |    46.8 |       25 |      60 |    46.8 | 222,240-316
  FunctionEvaluator.vue                                 |      80 |    85.71 |   84.21 |      80 | 184-196
  FunctionExplorer.vue                                  |   41.81 |    11.11 |   34.78 |   41.81 | ...76,294,313-317,322
  FunctionReport.vue                                    |   81.63 |       58 |   81.81 |   81.63 | ...58,168,174,202-212
  FunctionReportItem.vue                                |   97.22 |      100 |    90.9 |   97.22 | 141
  Publish.vue                                           |     100 |      100 |     100 |     100 |
  PublishDialog.vue                                     |   93.75 |    33.33 |     100 |   93.75 | 160,174
 ext.wikilambda.edit/composables                        |     100 |      100 |     100 |     100 |
  useBreakpoints.js                                     |     100 |      100 |     100 |     100 |
 ext.wikilambda.edit/mixins                             |   66.51 |    73.93 |   80.28 |   66.74 |
  api.js                                                |   93.33 |       75 |   83.33 |   93.33 | 53
  portray.js                                            |    4.38 |        0 |       0 |    4.42 | 48-317
  schemata.js                                           |   85.48 |    82.67 |      90 |   86.06 | 48-62,83,176-190,270
  typeUtils.js                                          |      90 |    89.53 |     100 |      90 | ...57,465,566,696-712
  urlUtils.js                                           |   88.88 |       75 |     100 |   88.88 | 18
  validator.js                                          |   30.76 |        0 |      50 |   30.76 | 27-32,46-54
  zobjectTreeUtils.js                                   |     100 |      100 |     100 |     100 |
 ext.wikilambda.edit/store                              |   95.45 |      100 |   71.42 |   95.34 |
  actions.js                                            |     100 |      100 |     100 |     100 |
  getters.js                                            |   94.44 |      100 |      80 |   94.11 | 34
  index.js                                              |     100 |      100 |     100 |     100 |
  mutations.js                                          |     100 |      100 |     100 |     100 |
  state.js                                              |      50 |      100 |       0 |      50 | 20
 ext.wikilambda.edit/store/classes                      |    92.3 |      100 |      80 |    92.3 |
  LabelData.js                                          |     100 |      100 |     100 |     100 |
  Row.js                                                |   88.88 |      100 |      75 |   88.88 | 61
 ext.wikilambda.edit/store/modules                      |   84.94 |    75.75 |   90.47 |   84.95 |
  arguments.js                                          |   85.71 |    83.33 |    90.9 |   85.71 | ...03,133-134,159-160
  callZFunction.js                                      |     100 |      100 |     100 |     100 |
  errors.js                                             |     100 |      100 |     100 |     100 |
  languages.js                                          |     100 |      100 |     100 |     100 |
  programmingLanguages.js                               |   57.14 |      100 |   66.66 |   57.14 | 49-79
  router.js                                             |     100 |      100 |     100 |     100 |
  zImplementations.js                                   |     100 |      100 |     100 |     100 |
  zKeys.js                                              |   97.32 |    78.18 |     100 |   97.32 | 323,337,376
  zTesterResults.js                                     |   93.93 |    78.43 |   95.23 |   93.93 | 36,57,243,274
  zTesters.js                                           |   20.54 |        0 |   36.84 |   20.83 | ...5-48,57-60,108-262
  zTypedList.js                                         |   21.05 |      3.7 |   28.57 |   21.05 | 13-20,63-127,157-268
  zobject.js                                            |   91.45 |     80.5 |   95.79 |    91.4 | ...483,2574-2584,2982
  zobjectModes.js                                       |     100 |      100 |     100 |     100 |
 ext.wikilambda.edit/store/modules/zobject              |   95.23 |    86.61 |   98.38 |   95.21 |
  addZObjects.js                                        |   96.45 |    91.02 |   97.56 |   96.42 | 73,579-584
  currentZObject.js                                     |   92.75 |    81.25 |     100 |   92.75 | 166,203-205,214-216
 ext.wikilambda.edit/views                              |    57.5 |     7.14 |   30.76 |    57.5 |
  DefaultView.vue                                       |   34.61 |        0 |       0 |   34.61 | 93-181
  FunctionEditor.vue                                    |     100 |      100 |     100 |     100 |
  FunctionViewer.vue                                    |     100 |      100 |     100 |     100 |
--------------------------------------------------------|---------|----------|---------|---------|-----------------------

Event Timeline

Test coverage is up to ~64% in the Vue code now:

-----------------------------------------|---------|----------|---------|---------|--------------------------------------------------------------------------------------------------------------------------------
File                                     | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s                                                                                                              
-----------------------------------------|---------|----------|---------|---------|--------------------------------------------------------------------------------------------------------------------------------
All files                                |    64.1 |    55.52 |   46.47 |   64.11 |                                                                                                                                
 ext.wikilambda.edit                     |      40 |      100 |       0 |      40 |                                                                                                                                
  Constants.js                           |     100 |      100 |     100 |     100 |                                                                                                                                
  index.js                               |       0 |      100 |       0 |       0 | 9-19                                                                                                                           
 ext.wikilambda.edit/components          |   65.84 |    43.88 |   46.84 |   65.84 |                                                                                                                                
  App.vue                                |     100 |      100 |     100 |     100 |                                                                                                                                
  ZFunctionSignature.vue                 |     100 |      100 |     100 |     100 |                                                                                                                                
  ZKeyModeSelector.vue                   |      90 |       50 |     100 |      90 | 71                                                                                                                             
  ZObject.vue                            |   91.11 |    81.25 |   85.71 |   91.11 | 116,142-144,154                                                                                                                
  ZObjectEditor.vue                      |   78.57 |    33.33 |   66.67 |   78.57 | 71,87-91                                                                                                                       
  ZObjectGeneric.vue                     |   43.75 |        0 |       0 |   43.75 | 71-121                                                                                                                         
  ZObjectJson.vue                        |   51.43 |       40 |   46.15 |   51.43 | 55,60,69-100,112,120-121                                                                                                       
  ZObjectKey.vue                         |   29.73 |        0 |       0 |   29.73 | 101-207                                                                                                                        
  ZObjectKeyInput.vue                    |      25 |        0 |       0 |      25 | 33-46                                                                                                                          
  ZObjectKeyList.vue                     |   33.33 |        0 |       0 |   33.33 | 59-119                                                                                                                         
  ZObjectSelector.vue                    |   80.95 |    56.41 |   88.24 |   80.95 | 104,108,159,215-219,235,242,265,271,279-284,292,309                                                                            
  ZObjectViewer.vue                      |     100 |      100 |     100 |     100 |                                                                                                                                
 ext.wikilambda.edit/components/function |   58.06 |    56.25 |   29.63 |   58.06 |                                                                                                                                
  ZFunctionTesterReport.vue              |   71.43 |     62.5 |      75 |   71.43 | 106-118,131-143                                                                                                                
  ZImplementationList.vue                |      50 |      100 |       0 |      50 | 54-71                                                                                                                          
  ZImplementationListItem.vue            |   28.57 |        0 |       0 |   28.57 | 71-118                                                                                                                         
  ZTesterImplResult.vue                  |     100 |      100 |     100 |     100 |                                                                                                                                
  ZTesterList.vue                        |      50 |      100 |       0 |      50 | 52-69                                                                                                                          
  ZTesterListItem.vue                    |      60 |      100 |       0 |      60 | 51-63                                                                                                                          
 ext.wikilambda.edit/components/types    |   34.37 |     3.66 |    7.83 |   34.37 |                                                                                                                                
  ZArgument.vue                          |   26.67 |        0 |       0 |   26.67 | 57-112                                                                                                                         
  ZArgumentList.vue                      |      50 |      100 |       0 |      50 | 36-44                                                                                                                          
  ZArgumentReference.vue                 |   55.56 |        0 |       0 |   55.56 | 48-63                                                                                                                          
  ZBoolean.vue                           |   38.46 |        0 |       0 |   38.46 | 56-83                                                                                                                          
  ZCharacter.vue                         |   55.56 |      100 |       0 |   55.56 | 48-70                                                                                                                          
  ZCode.vue                              |   23.08 |        0 |       0 |   23.08 | 57-160                                                                                                                         
  ZFunction.vue                          |   30.56 |        0 |       0 |   30.56 | 79-161                                                                                                                         
  ZFunctionCall.vue                      |   14.49 |        0 |       0 |   14.49 | 102-282                                                                                                                        
  ZImplementation.vue                    |   23.91 |        0 |       0 |   23.91 | 89-236                                                                                                                         
  ZList.vue                              |   91.67 |      100 |   83.33 |   91.67 | 61                                                                                                                             
  ZListItem.vue                          |   81.25 |      100 |      75 |   81.25 | 80,100-104                                                                                                                     
  ZMonolingualString.vue                 |   23.81 |        0 |       0 |   23.81 | 56-128                                                                                                                         
  ZMultilingualString.vue                |      20 |        0 |       0 |      20 | 64-166                                                                                                                         
  ZNothing.vue                           |   66.67 |      100 |       0 |   66.67 | 16-22                                                                                                                          
  ZPersistentObject.vue                  |   42.86 |      100 |       0 |   42.86 | 71-96                                                                                                                          
  ZReference.vue                         |   42.86 |        0 |       0 |   42.86 | 65-100                                                                                                                         
  ZString.vue                            |      75 |       50 |   66.67 |      75 | 48,66-70                                                                                                                       
  ZTester.vue                            |      50 |        0 |       0 |      50 | 58-82                                                                                                                          
 ext.wikilambda.edit/mixins              |   92.79 |    87.34 |   90.48 |   92.73 |                                                                                                                                
  callZFunction.js                       |     100 |       50 |     100 |     100 | 31                                                                                                                             
  schemata.js                            |     100 |    98.18 |     100 |     100 | 84                                                                                                                             
  typeUtils.js                           |   79.17 |    68.75 |   66.67 |   79.17 | 24,28,48-52                                                                                                                    
  validator.js                           |   76.92 |       50 |     100 |   76.92 | 28,47,51                                                                                                                       
 ext.wikilambda.edit/store               |     100 |    66.67 |     100 |     100 |                                                                                                                                
  actions.js                             |     100 |      100 |     100 |     100 |                                                                                                                                
  getters.js                             |     100 |    66.67 |     100 |     100 | 16-18                                                                                                                          
  index.js                               |     100 |      100 |     100 |     100 |                                                                                                                                
  mutations.js                           |     100 |      100 |     100 |     100 |                                                                                                                                
  state.js                               |     100 |      100 |     100 |     100 |                                                                                                                                
 ext.wikilambda.edit/store/modules       |   76.62 |    66.41 |   80.84 |   76.75 |                                                                                                                                
  callZFunction.js                       |   58.33 |        0 |      80 |   58.33 | 13-20                                                                                                                          
  languages.js                           |     100 |       80 |     100 |     100 | 102-118                                                                                                                        
  programmingLanguages.js                |   16.67 |      100 |       0 |   16.67 | 23-76                                                                                                                          
  zKeys.js                               |   65.38 |    61.11 |   53.33 |   65.38 | 18-26,64-81,110-113,157,200,230,243-274                                                                                        
  zTesterResults.js                      |   96.23 |    83.33 |     100 |   96.23 | 95,107                                                                                                                         
  zobject.js                             |   74.61 |    62.11 |   84.27 |   74.81 | ...7-278,302,383,428,481-483,498,528-529,566-603,631,637,695-709,892,958-974,1019-1046,1069,1073,1122-1172,1192-1194,1198-1212 
  zobjectModes.js                        |     100 |      100 |     100 |     100 |                                                                                                                                
 lib                                     |     100 |      100 |     100 |     100 |                                                                                                                                
  icons.js                               |     100 |      100 |     100 |     100 |                                                                                                                                
-----------------------------------------|---------|----------|---------|---------|--------------------------------------------------------------------------------------------------------------------------------

A majority of the files with less than 50% coverage are Vue components which will be changing (potentially in a significant way) as we build out the new UI. The core logic of the application is located within Vuex modules, which currently have ~76% coverage. Of those files, only one is below 50%, which is a placeholder until programming languages are implemented in MW.

Change 925809 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/extensions/WikiLambda@master] zobjectTreeUtils: Drop convertZObjectToTree, no callers left

https://gerrit.wikimedia.org/r/925809

Change 925812 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/extensions/WikiLambda@master] jest: Add specific mixins code coverage standards

https://gerrit.wikimedia.org/r/925812

Change 925809 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] zobjectTreeUtils: Drop convertZObjectToTree, no callers left

https://gerrit.wikimedia.org/r/925809

Change 925812 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] jest: Add specific mixins code coverage standards

https://gerrit.wikimedia.org/r/925812

Change 926614 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/extensions/WikiLambda@master] jest: Raise code coverage standards to current level, so we don't regress

https://gerrit.wikimedia.org/r/926614

Change 926614 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] jest: Raise code coverage standards to current level, so we don't regress

https://gerrit.wikimedia.org/r/926614