@teleporthq/teleport-project-generator-html 0.22.2 → 0.22.3
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.
- package/__tests__/end2end/index.ts +31 -8
- package/package.json +3 -3
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import uidlSample from '../../../../examples/uidl-samples/project.json'
|
|
2
2
|
import invalidUidlSample from '../../../../examples/test-samples/project-invalid-sample.json'
|
|
3
|
+
import projectWithSlot from '../../../../examples/test-samples/project-with-slot.json'
|
|
3
4
|
import { createHTMLProjectGenerator } from '../../src'
|
|
4
5
|
import HTMLTemplate from '../../src/project-template'
|
|
5
6
|
import { FileType } from '@teleporthq/teleport-types'
|
|
@@ -15,10 +16,11 @@ describe('Html Project Generator', () => {
|
|
|
15
16
|
expect(name).toBe('teleport-project-html')
|
|
16
17
|
expect(files.length).toBe(8)
|
|
17
18
|
expect(subFolders.length).toBe(1)
|
|
18
|
-
expect(aboutPage
|
|
19
|
-
expect(aboutPage
|
|
20
|
-
expect(aboutPage
|
|
21
|
-
expect(
|
|
19
|
+
expect(aboutPage).toBeDefined()
|
|
20
|
+
expect(aboutPage?.content).toContain('head')
|
|
21
|
+
expect(aboutPage?.content).toContain('html')
|
|
22
|
+
expect(aboutPage?.content).toContain('public/playground_assets/kitten.png')
|
|
23
|
+
expect(aboutCSS?.content).toContain('public/playground_assets/kitten.png')
|
|
22
24
|
})
|
|
23
25
|
|
|
24
26
|
it('run withut crashing and appends entry things into single index.html', async () => {
|
|
@@ -33,10 +35,10 @@ describe('Html Project Generator', () => {
|
|
|
33
35
|
expect(name).toBe('teleport-project-html')
|
|
34
36
|
expect(files.length).toBe(9)
|
|
35
37
|
expect(subFolders.length).toBe(1)
|
|
36
|
-
expect(aboutPage
|
|
37
|
-
expect(aboutPage
|
|
38
|
-
expect(aboutPage
|
|
39
|
-
expect(aboutCSS
|
|
38
|
+
expect(aboutPage?.content).not.toContain('<head>')
|
|
39
|
+
expect(aboutPage?.content).not.toContain('<html>')
|
|
40
|
+
expect(aboutPage?.content).toContain('public/playground_assets/kitten.png')
|
|
41
|
+
expect(aboutCSS?.content).toContain('public/playground_assets/kitten.png')
|
|
40
42
|
})
|
|
41
43
|
|
|
42
44
|
it('throws error when invalid UIDL sample is used', async () => {
|
|
@@ -44,3 +46,24 @@ describe('Html Project Generator', () => {
|
|
|
44
46
|
await expect(result).rejects.toThrow(Error)
|
|
45
47
|
})
|
|
46
48
|
})
|
|
49
|
+
|
|
50
|
+
describe('Unwinds the slot inside the component when used in page', () => {
|
|
51
|
+
const generator = createHTMLProjectGenerator()
|
|
52
|
+
|
|
53
|
+
it('runs without crashing', async () => {
|
|
54
|
+
const result = await generator.generateProject(projectWithSlot, HTMLTemplate)
|
|
55
|
+
const indexFile = result.files.find(
|
|
56
|
+
(file) => file.name === 'index' && file.fileType === FileType.HTML
|
|
57
|
+
)
|
|
58
|
+
const cssFile = result.files.find(
|
|
59
|
+
(file) => file.name === 'home' && file.fileType === FileType.CSS
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
expect(indexFile).toBeDefined()
|
|
63
|
+
expect(indexFile?.content).toContain(`app-component-image1`)
|
|
64
|
+
expect(indexFile?.content).toContain(`app-component-image2`)
|
|
65
|
+
expect(cssFile).toBeDefined()
|
|
66
|
+
expect(cssFile?.content).toContain(`.app-component-image2`)
|
|
67
|
+
expect(cssFile?.content).toContain(`.app-component-image1`)
|
|
68
|
+
})
|
|
69
|
+
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teleporthq/teleport-project-generator-html",
|
|
3
|
-
"version": "0.22.
|
|
3
|
+
"version": "0.22.3",
|
|
4
4
|
"description": "Project generator for generate plain html files",
|
|
5
5
|
"author": "teleportHQ",
|
|
6
6
|
"license": "MIT",
|
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@teleporthq/teleport-component-generator": "^0.22.0",
|
|
28
|
-
"@teleporthq/teleport-component-generator-html": "^0.22.
|
|
28
|
+
"@teleporthq/teleport-component-generator-html": "^0.22.3",
|
|
29
29
|
"@teleporthq/teleport-plugin-css": "^0.22.0",
|
|
30
30
|
"@teleporthq/teleport-postprocessor-prettier-html": "^0.22.0",
|
|
31
31
|
"@teleporthq/teleport-project-generator": "^0.22.0",
|
|
32
32
|
"cheerio": "^1.0.0-rc.12",
|
|
33
33
|
"path-browserify": "^1.0.1"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "7f670fc2d9d6468f9689712e424f5bff3c9c8a0b"
|
|
36
36
|
}
|