mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Moving widget tests to core
Summary: - Custom widget tests are now in grist-core - Adding buildtools for grist-plugin-api.js Test Plan: Existing tests Reviewers: paulfitz Reviewed By: paulfitz Differential Revision: https://phab.getgrist.com/D3617
This commit is contained in:
11
test/fixtures/sites/probe/index.html
vendored
Normal file
11
test/fixtures/sites/probe/index.html
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<script src="/grist-plugin-api.js"></script>
|
||||
<script src="page.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Probe</h1>
|
||||
<div id="placeholder"></div>
|
||||
</body>
|
||||
</html>
|
||||
20
test/fixtures/sites/probe/page.js
vendored
Normal file
20
test/fixtures/sites/probe/page.js
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
|
||||
/* global document, grist, window */
|
||||
|
||||
grist.ready();
|
||||
|
||||
function readDoc() {
|
||||
const api = grist.rpc.getStub("GristDocAPI@grist", grist.checkers.GristDocAPI);
|
||||
const placeholder = document.getElementById('placeholder');
|
||||
const fallback = setTimeout(() => {
|
||||
placeholder.innerHTML = '<div id="output">no joy</div>';
|
||||
}, 1000);
|
||||
api.listTables()
|
||||
.then(tables => {
|
||||
clearTimeout(fallback);
|
||||
placeholder.innerHTML = `<div id="output">${JSON.stringify(tables)}</div>`;
|
||||
});
|
||||
}
|
||||
|
||||
window.onload = readDoc;
|
||||
Reference in New Issue
Block a user