-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cypress test test.html in cypress/pages
- Loading branch information
Showing
5 changed files
with
60 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"baseUrl": "http://localhost:3030" | ||
"baseUrl": "http://localhost:3030/cypress/pages/" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"name": "Using fixtures to represent data", | ||
"email": "[email protected]", | ||
"body": "Fixtures are a great way to mock data for responses to routes" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,21 @@ | ||
describe('My First Test', () => { | ||
it('Does not do much!', () => { | ||
expect(true).to.equal(true) | ||
describe('Starting with simple area', () => { | ||
beforeEach(() => { | ||
cy.visit('test'); | ||
const cfg = { | ||
components: [{ render(h) { return h("div", "Hey !") } }], | ||
layout: { | ||
componentIndex: 0 | ||
} | ||
}; | ||
cy.window().then(win => { | ||
win.areas = win.mountApp(cfg); | ||
}); | ||
}); | ||
|
||
it('Should render the simple area', () => { | ||
cy.get("#window-1").contains("Hey !"); | ||
cy.window().then(win => { | ||
cy.get("#app").then(app => expect(win.areas.$el).to.equal(app)) | ||
}) | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Window manager</title> | ||
</head> | ||
|
||
<body> | ||
<div id="app"></div> | ||
<script type="module"> | ||
import Vue from 'https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.esm.browser.js'; | ||
import WindowManager from "../../dist/windowmanager.esm.js"; | ||
|
||
window.mountApp = cfg => | ||
new Vue({ | ||
render(h) { | ||
return h("div", { style: "width: 80%; margin: auto; height: 600px;", domProps: { id: "app" } }, [h(WindowManager, | ||
{ | ||
ref: "windowmanager", | ||
props: { | ||
cfg | ||
} | ||
} | ||
)]); | ||
}, | ||
}).$mount('#app'); | ||
// vm.$refs.windowmanager.getComponentByName("comp1").cfg.props.text = "Youhou ! =D"; // This is reactive ! | ||
</script> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters