@hopara/iframe 0.1.112 → 0.1.114

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ const systemTest = require('@hopara/system-test')
2
+ module.exports = systemTest.nightwatch.conf
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hopara/iframe",
3
- "version": "0.1.112",
3
+ "version": "0.1.114",
4
4
  "main": "build/client.js",
5
5
  "scripts": {
6
6
  "start": "ESLINT_NO_DEV_ERRORS=true react-app-rewired start",
@@ -27,12 +27,14 @@
27
27
  ],
28
28
  "devDependencies": {
29
29
  "@babel/register": "^7.15.3",
30
- "@hopara/components": "^0.1.112",
30
+ "@hopara/components": "^0.1.114",
31
+ "@hopara/system-test": "^0.1.114",
31
32
  "babel-loader": "8.1.0",
32
33
  "customize-cra": "^1.0.0",
33
34
  "react": "^18.2.0",
34
35
  "react-app-rewired": "^2.2.1",
35
36
  "react-dom": "^18.2.0",
37
+ "react-router-dom": "^6.10.0",
36
38
  "typescript": "^4.5.2"
37
39
  }
38
40
  }
@@ -0,0 +1,34 @@
1
+ const mockServer = require('mockttp').getLocal({cors: true})
2
+ const {responses} = require('@hopara/system-test')
3
+
4
+ const waitTime = () => {
5
+ if (process.env.DEBUGGER) return 1200000
6
+ return 500
7
+ }
8
+
9
+ const mismatchPercentage = 0.2
10
+
11
+ module.exports = {
12
+ 'before': async () => await mockServer.start(1234),
13
+ 'after': async () => await mockServer.stop(),
14
+
15
+ 'Circle Layer': (browser) => {
16
+ mockServer.get('/app/circle').thenReply(200, JSON.stringify(responses.app.circle))
17
+ mockServer.get('/view/queryName/row').thenReply(200, JSON.stringify(responses.geo.circle))
18
+
19
+ browser.setWindowSize(1280, 800)
20
+ .url('http://localhost:3456/')
21
+ .execute(() => {
22
+ window.postMessage({
23
+ app: 'circle',
24
+ tenant: 'hopara.io',
25
+ accessToken: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyLCJ0ZW5hbnRzIjpbImhvcGFyYS5pbyJdLCJzY29wZSI6InJvdzp3cml0ZSJ9.qJwSd1EUmiVX5NrgelVQdn9MDbdVNq4GGjzHPQlDQ1A',
26
+ targetElementId: 'embedded-target-element',
27
+ __hopara__eventType__: 'init'
28
+ }, '*')
29
+ })
30
+ .pause(waitTime())
31
+ .waitForElementVisible('#deckgl-overlay')
32
+ .assert.compareScreenshot('circle-layer.png', mismatchPercentage)
33
+ },
34
+ }
@@ -0,0 +1,15 @@
1
+ /* eslint-disable no-invalid-this */
2
+ const path = require('path')
3
+ const {nightwatch} = require('@hopara/system-test')
4
+
5
+ const BUILD_DIR_NAME = process.env['BUILD_DIR_NAME'] || 'build'
6
+ const buildPath = path.resolve(__dirname, '../', BUILD_DIR_NAME)
7
+ const server = nightwatch.createServer(buildPath)
8
+
9
+ server.listen(3456, 'localhost', function(err) {
10
+ // eslint-disable-next-line
11
+ console.log('server starting...', this.address())
12
+
13
+ if (err) throw err
14
+ nightwatch.spawCmd(this)
15
+ })