[FOLIO-1574] Big Test Run produces javascript error Created: 12/Oct/18  Updated: 12/Nov/18  Resolved: 25/Oct/18

Status: Closed
Project: FOLIO
Components: None
Affects versions: None
Fix versions: None

Type: Bug Priority: P2
Reporter: Eric Valuk Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original estimate: Not Specified

Sprint:
Development Team: Prokopovych

 Description   

My branch of ui-checkin regarding Pact implementation FOLIO-1458-Implement-Pact-enabled-contract-tests-for-UI-Checkin-module currently runs with this error visible in the browser console window.

uncaught (in promise) TypeError: Cannot read property 'en' of undefined

line 38 of stripes-core/src/loginServices.js

during debug I see:

ReferenceError: loadTranslations is not defined at eval (eval at loadTranslations (http://localhost:9876/base/test/pact-testing/pact-testing.spec.js:27603:6), <anonymous>:1:1) at loadTranslations (http://localhost:9876/base/test/pact-testing/pact-testing.spec.js:27603:6) at ProxyComponent.componentDidMount (http://localhost:9876/base/test/pact-testing/pact-testing.spec.js:24831:43) at......

when I mouse over the variable for translations inside that file.



 Comments   
Comment by Eric Valuk [ 12/Oct/18 ]

CHROME_BIN=/usr/bin/chromium-browser DEBUG=stripes-core:stripesTranslationsPlugin,stripes-core:stripesConfigPlugin yarn test
yarn run v1.10.1
$ stripes test karma
Starting Karma tests...
stripes-core:stripesConfigPlugin initializing... +0ms
stripes-core:stripesTranslationsPlugin language filter [ 'en' ] +0ms
stripes-core:stripesConfigPlugin enabled modules: { '@folio/checkin': {} } +3ms
stripes-core:stripesTranslationsPlugin loading translations from directory /home/eric/stripes/node_modules/@folio/stripes-core/translations/stripes-core +6ms
stripes-core:stripesTranslationsPlugin loading translations from directory /home/eric/stripes/node_modules/@folio/stripes-core/node_modules/@folio/stripes-components/translations/stripes-components +1ms
stripes-core:stripesTranslationsPlugin loading translations from directory /home/eric/stripes/node_modules/@folio/stripes-smart-components/translations/stripes-smart-components +1ms
stripes-core:stripesTranslationsPlugin cannot find /home/eric/stripes/node_modules/@folio/stripes-form/translations/stripes-form falling back to /home/eric/stripes/node_modules/@folio/stripes-form/translations +1ms
stripes-core:stripesTranslationsPlugin loading translations from directory /home/eric/stripes/node_modules/@folio/stripes-form/translations +8ms
stripes-core:stripesTranslationsPlugin loading translations from directory /home/eric/stripes/ui-checkin/translations/ui-checkin +1ms
stripes-core:stripesTranslationsPlugin stripesConfigPluginBeforeWrite

{ en: '/tmp/_karma_webpack_/translations/en-1539203870883.json' }

+69ms
stripes-core:stripesConfigPlugin writing virtual module...
const

{ okapi, config, modules }

= {
"okapi":

{ "url": "http:\u002F\u002Flocalhost:9130", "tenant": "diku" }

,
"config":

{ "logCategories": "core,path,action,xhr", "logPrefix": "--", "showPerms": false, "hasAllPerms": true, "languages": [ "en" ] }

,
"modules": {
"app": [
{
"displayName": "ui-checkin.meta.title",
"route": "\u002Fcheckin",
"queryResource": "query",
"hasSettings": false,
"icons": [

{ "name": "app", "alt": "Check in items", "title": "Checkout" }

],
"okapiInterfaces":

{ "circulation": "3.0 4.0", "configuration": "2.0", "item-storage": "5.0 6.0", "loan-policy-storage": "1.0", "users": "15.0" }

,
"permissionSets": [

{ "permissionName": "module.checkin.enabled", "displayName": "UI: Check in module is enabled" }

,

{ "permissionName": "ui-checkin.all", "displayName": "Check in: All permissions", "description": "Entire set of permissions needed to use Checkin", "visible": true, "subPermissions": [ "circulation.all", "circulation-storage.all", "configuration.all", "users.collection.get", "module.checkin.enabled" ] }

],
"module": "@folio\u002Fcheckin",
"getModule": function anonymous(
/``/)

{ return require('@folio/checkin').default; }

,
"description": "Item Check-in",
"version": "1.3.0"
}
]
}
};
const branding = {
"logo":

{ "src": require('/home/eric/stripes/node_modules/@folio/stripes-core/default-assets/folio-logo.svg'), "alt": "FOLIO" }

,
"favicon":

{ "src": require('/home/eric/stripes/node_modules/@folio/stripes-core/default-assets/favicon.svg') }

};
const translations =

{ "en": "\u002Ftmp\u002F_karma_webpack_\u002Ftranslations\u002Fen-1539203870883.json" }

;
const metadata = {
"checkin": {
"name": "checkin",
"version": "1.3.0",
"description": "Item Check-in",
"license": "Apache-2.0",
"type": "app",
"shortTitle": "ui-checkin.meta.title",
"icons": {
"app": {
"alt": "Check in items",
"title": "Checkout",
"high":

{ "src": require('/home/eric/stripes/ui-checkin/icons/app.svg') }

,
"src": require('/home/eric/stripes/ui-checkin/icons/app.svg'),
"low":

{ "src": require('/home/eric/stripes/ui-checkin/icons/app.png') }

}
},
"welcomePageEntries": []
}
};
export

{ okapi, config, modules, branding, translations, metadata }

;
+88ms
[2018-10-10T20:37:51.106Z] INFO: pact-node@6.19.11/2671 on eric-VirtualBox:
Creating Pact Server with options:
consumer = ui-checkin,
provider = mod-circulation,
port = 9130,
log = /home/eric/stripes/ui-checkin/logs/pact.log,
dir = /home/eric/stripes/ui-checkin/pacts,
logLevel = DEBUG,
spec = 3,
cors = true,
pactFileWriteMode = overwrite,
ssl = false,
host = localhost
[2018-10-10T20:37:51.128Z] INFO: pact-node@6.19.11/2671 on eric-VirtualBox: Created './standalone/linux-x64-1.54.4/bin/pact-mock-service service --consumer 'ui-checkin' --provider 'mod-circulation' --port '9130' --log '/home/eric/stripes/ui-checkin/logs/pact.log' --pact_dir '/home/eric/stripes/ui-checkin/pacts' --log-level 'DEBUG' --pact_specification_version '3' --cors 'true' --pact-file-write-mode 'overwrite' --host 'localhost'' process with PID: 2691
(node:2671) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
10 10 2018 16:37:54.932:INFO [pact]: Pact Mock Server running on port: 9130
ℹ 「wdm」: wait until bundle finished: noop
stripes-core:stripesTranslationsPlugin emitting translations for en --> translations/en-1539203870883.json +46s
10 10 2018 16:38:39.312:WARN [karma]: No captured browser, open http://localhost:9876/
⚠ 「wdm」:
ℹ 「wdm」: Compiled with warnings.
10 10 2018 16:38:39.353:INFO [karma]: Karma v3.0.0 server started at http://0.0.0.0:9876/
10 10 2018 16:38:39.354:INFO [launcher]: Launching browser Chrome with unlimited concurrency
10 10 2018 16:38:39.366:INFO [launcher]: Starting browser Chrome
10 10 2018 16:38:45.845:INFO [Chromium 69.0.3497 (Ubuntu 0.0.0)]: Connected on socket 3E1T5uYGP_Ufdqs3AAAA with id 94390076

START:
WARN: 'Passing in consumer/provider to PactWeb is deprecated,
and will be removed in the next major version'
INFO: 'Setting up Pact using mock service on port: "9130"'
checkin pact tests
✖ has a barcode field
LOG: 'after triggered'

Finished in 3.414 secs / 2.01 secs @ 16:38:52 GMT-0400 (EDT)

SUMMARY:
✔ 0 tests completed
✖ 1 test failed

FAILED TESTS:
checkin pact tests
✖ has a barcode field
Chromium 69.0.3497 (Ubuntu 0.0.0)
AssertionError: expected false to be true

+ expected - actual

-false
+true

at Context.<anonymous> (test/pact-testing/pact-testing.spec.js:336684:86)
at loop (test/pact-testing/pact-testing.spec.js:8290:23)

Comment by Eric Valuk [ 25/Oct/18 ]

This was resolved by removing the stripes.conf.js file that was present in an example pact implementation. Most likely included due to being an older version of stripes.

Generated at Thu Feb 08 23:14:20 UTC 2024 using Jira 1001.0.0-SNAPSHOT#100246-sha1:7a5c50119eb0633d306e14180817ddef5e80c75d.