mockaton 8.2.0 → 8.2.2

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.
Files changed (68) hide show
  1. package/.idea/dictionaries/efortis.xml +3 -0
  2. package/.idea/encodings.xml +6 -0
  3. package/.idea/inspectionProfiles/Project_Default.xml +105 -0
  4. package/.idea/jsLibraryMappings.xml +6 -0
  5. package/.idea/jsLinters/eslint.xml +6 -0
  6. package/.idea/misc.xml +115 -0
  7. package/.idea/mockaton.iml +8 -0
  8. package/.idea/modules.xml +8 -0
  9. package/.idea/shelf/custom_methods,_but_nodejs_does_not_support_them_https___github_com_nodejs_llhttp_pull_54/shelved.patch +260 -0
  10. package/.idea/shelf/custom_methods__but_nodejs_does_not_support_them_https___github_com_nodejs_llhttp_pull_54.xml +4 -0
  11. package/.idea/shelf/preflight/shelved.patch +122 -0
  12. package/.idea/shelf/preflight.xml +4 -0
  13. package/.idea/shelf/preflight1/shelved.patch +289 -0
  14. package/.idea/shelf/preflight1.xml +4 -0
  15. package/.idea/shelf/ts/shelved.patch +229 -0
  16. package/.idea/shelf/ts.xml +4 -0
  17. package/.idea/vcs.xml +6 -0
  18. package/.idea/webResources.xml +14 -0
  19. package/.idea/workspace.xml +248 -0
  20. package/README.md +17 -7
  21. package/index.d.ts +5 -0
  22. package/index.js +3 -1
  23. package/package.json +5 -4
  24. package/src/Dashboard.css +10 -9
  25. package/src/Dashboard.js +1 -3
  26. package/src/mockaton-logo.svg +1 -1
  27. package/src/utils/http-response.js +4 -4
  28. package/.editorconfig +0 -11
  29. package/README-dashboard-dark.png +0 -0
  30. package/README-dashboard-light.png +0 -0
  31. package/sample-mocks/api/user/avatar.GET.200.png +0 -0
  32. package/sample-mocks/api/user/edit-name.PATCH.200.json +0 -3
  33. package/sample-mocks/api/user/edit-name.PATCH.422.json +0 -3
  34. package/sample-mocks/api/user/friends.GET.200.json +0 -3
  35. package/sample-mocks/api/user/friends.GET.204.json +0 -4
  36. package/sample-mocks/api/user/friends.GET.500.txt +0 -7
  37. package/sample-mocks/api/user/likes.GET.200.js +0 -9
  38. package/sample-mocks/api/user/links.GET.200.js +0 -9
  39. package/sample-mocks/api/user/logout.POST.200.json +0 -1
  40. package/sample-mocks/api/user/typescript-scores-full.GET.200.ts +0 -9
  41. package/sample-mocks/api/user/typescript-scores.GET.200.ts +0 -6
  42. package/sample-mocks/api/user/videos(all variants).GET.200.json +0 -13
  43. package/sample-mocks/api/user/videos(default).GET.200.json +0 -13
  44. package/sample-mocks/api/user/videos(verified)(another comment).GET.200.json +0 -13
  45. package/sample-mocks/api/user/yaml-fruits.GET.200.yml +0 -5
  46. package/sample-mocks/api/user.GET.200.json +0 -4
  47. package/sample-mocks/api/video/[id].GET.200.json +0 -4
  48. package/sample-mocks/api/video/stat/[stat-id]/[video-id].GET.200.json +0 -3
  49. package/sample-mocks/api/video/stat/[stat-id]/all-videos?limit=[limit].GET.200.json +0 -4
  50. package/sample-static/another-entry/index.html +0 -35
  51. package/sample-static/assets/video.mp4 +0 -0
  52. package/sample-static/index.html +0 -37
  53. package/ui-tests/_setup.js +0 -32
  54. package/ui-tests/bulk-select.test.js +0 -10
  55. package/ui-tests/bulk-select.vp1024x800.dark.gold.png +0 -0
  56. package/ui-tests/bulk-select.vp1024x800.light.gold.png +0 -0
  57. package/ui-tests/initial-dashboard-state.test.js +0 -4
  58. package/ui-tests/initial-dashboard-state.vp1024x800.dark.gold.png +0 -0
  59. package/ui-tests/initial-dashboard-state.vp1024x800.light.gold.png +0 -0
  60. package/ui-tests/payload-viewer-formats-json.test.js +0 -9
  61. package/ui-tests/payload-viewer-formats-json.vp1024x800.dark.gold.png +0 -0
  62. package/ui-tests/payload-viewer-formats-json.vp1024x800.light.gold.png +0 -0
  63. package/ui-tests/payload-viewer-renders-images.test.js +0 -9
  64. package/ui-tests/payload-viewer-renders-images.vp1024x800.dark.gold.png +0 -0
  65. package/ui-tests/payload-viewer-renders-images.vp1024x800.light.gold.png +0 -0
  66. package/ui-tests/select-mock-variant.test.js +0 -10
  67. package/ui-tests/select-mock-variant.vp1024x800.dark.gold.png +0 -0
  68. package/ui-tests/select-mock-variant.vp1024x800.light.gold.png +0 -0
@@ -1,35 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta content="width=device-width" name="viewport">
6
- <link rel="icon" href="data:">
7
- <title>Another Entry Point</title>
8
- </head>
9
- <body>
10
- <h1>Another Entry Point</h1>
11
-
12
- <h2>/api/user</h2>
13
- <pre></pre>
14
- <script>
15
- (async () => {
16
- let output = ''
17
- try {
18
- const response = await fetch('/api/user')
19
- if (response.ok) {
20
- const json = await response.json()
21
- output = JSON.stringify(json, null, 2)
22
- }
23
- else
24
- throw response.status
25
- }
26
- catch (error) {
27
- output = 'Error: ' + error
28
- }
29
- finally {
30
- document.querySelector('pre').innerText = output
31
- }
32
- })()
33
- </script>
34
- </body>
35
- </html>
Binary file
@@ -1,37 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta content="width=device-width" name="viewport">
6
- <link rel="icon" href="data:">
7
- <title>Title</title>
8
- </head>
9
- <body>
10
- <h1>Welcome!</h1>
11
- <video src="assets/video.mp4" width="720" controls></video>
12
-
13
- <h2>/api/user</h2>
14
- <pre></pre>
15
-
16
- <script>
17
- (async () => {
18
- let output = ''
19
- try {
20
- const response = await fetch('/api/user')
21
- if (response.ok) {
22
- const json = await response.json()
23
- output = JSON.stringify(json, null, 2)
24
- }
25
- else
26
- throw response.status
27
- }
28
- catch (error) {
29
- output = 'Error: ' + error
30
- }
31
- finally {
32
- document.querySelector('pre').innerText = output
33
- }
34
- })()
35
- </script>
36
- </body>
37
- </html>
@@ -1,32 +0,0 @@
1
- import { after } from 'node:test'
2
- import { launch } from 'puppeteer'
3
- import {
4
- removeDiffsAndCandidates,
5
- testPixels as _testPixels,
6
- diffServer
7
- } from 'pixaton'
8
- import { Commander } from '../index.js'
9
-
10
- // Before running these tests you need to spin up the demo:
11
- // npm run demo
12
-
13
- const MOCKATON_ADDR = 'http://localhost:2345'
14
- const mockaton = new Commander(MOCKATON_ADDR)
15
-
16
- const testsDir = import.meta.dirname
17
-
18
- removeDiffsAndCandidates(testsDir)
19
- const browser = await launch({ headless: true })
20
- const page = await browser.newPage()
21
-
22
- after(() => {
23
- browser?.close()
24
- diffServer(testsDir)
25
- })
26
-
27
- export function testPixels(testFileName, options = {}) {
28
- options.beforeSuite = async () => await mockaton.reset()
29
- options.viewports ??= [{ width: 1024, height: 800 }]
30
- options.colorSchemes ??= ['light', 'dark']
31
- _testPixels(page, testFileName, MOCKATON_ADDR + '/mockaton', 'body', options)
32
- }
@@ -1,10 +0,0 @@
1
- import { testPixels } from './_setup.js'
2
-
3
-
4
- testPixels(import.meta.filename, {
5
- async setup(page) {
6
- const qaId = 'BulkSelector'
7
- const target = '(Mockaton 500)'
8
- await page.select(`select[data-qaid="${qaId}"]`, target)
9
- }
10
- })
@@ -1,4 +0,0 @@
1
- import { testPixels } from './_setup.js'
2
-
3
-
4
- testPixels(import.meta.filename)
@@ -1,9 +0,0 @@
1
- import { testPixels } from './_setup.js'
2
-
3
-
4
- testPixels(import.meta.filename, {
5
- async setup(page) {
6
- const linkText = '/api/user'
7
- await page.locator(`a ::-p-text(${linkText})`).click()
8
- }
9
- })
@@ -1,9 +0,0 @@
1
- import { testPixels } from './_setup.js'
2
-
3
-
4
- testPixels(import.meta.filename, {
5
- async setup(page) {
6
- const linkText = '/api/user/avatar'
7
- await page.locator(`a ::-p-text(${linkText})`).click()
8
- }
9
- })
@@ -1,10 +0,0 @@
1
- import { testPixels } from './_setup.js'
2
-
3
-
4
- testPixels(import.meta.filename, {
5
- async setup(page) {
6
- const qaId = '/api/user/friends'
7
- const target = 'api/user/friends.GET.204.json'
8
- await page.select(`select[data-qaid="${qaId}"]`, target)
9
- }
10
- })