Skip to content

Commit

Permalink
0.0.22
Browse files Browse the repository at this point in the history
  • Loading branch information
bahrus committed Feb 29, 2024
1 parent 6e2f793 commit aea4b8c
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
42 changes: 42 additions & 0 deletions tests/Test2.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Test 2</title>
</head>
<body>
<data id=data></data>
<div id=target></div>

<script type=importmap>
{
"imports": {
"be-enhanced/": "../node_modules/be-enhanced/",
"be-hive/": "../node_modules/be-hive/",
"be-propagating/": "../node_modules/be-propagating/",
"mount-observer/": "../node_modules/mount-observer/",
"trans-render/": "../node_modules/trans-render/",
"xtal-element/": "../node_modules/xtal-element/"
}
}
</script>
<script type=module>
import 'be-enhanced/beEnhanced.js';
import '../be-value-added.js';
</script>
<script type=module>
function validate(){
const num = 13456789;
if(data.textContent === num.toLocaleString()){
target.setAttribute('mark', 'good');
}
}
await customElements.whenDefined('be-enhanced');
data.beEnhanced.by.beValueAdded.value = 13456789;
setTimeout(() => {
validate();
}, 100);
</script>
</body>
</html>
8 changes: 8 additions & 0 deletions tests/test2.spec.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { test, expect } from '@playwright/test';
test('test1', async ({ page }) => {
await page.goto('./tests/Test1.html');
// wait for 1 second
await page.waitForTimeout(2000);
const editor = page.locator('#target');
await expect(editor).toHaveAttribute('mark', 'good');
});

0 comments on commit aea4b8c

Please sign in to comment.