From 3fdd1969b4de0c28f5d198cbb339c77621fb7da6 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sat, 20 Apr 2019 14:07:27 +0900 Subject: Add e2e tests for follow --- e2e/follow.test.js | 257 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 257 insertions(+) create mode 100644 e2e/follow.test.js (limited to 'e2e') diff --git a/e2e/follow.test.js b/e2e/follow.test.js new file mode 100644 index 0000000..7e49119 --- /dev/null +++ b/e2e/follow.test.js @@ -0,0 +1,257 @@ +const express = require('express'); +const lanthan = require('lanthan'); +const path = require('path'); +const assert = require('assert'); +const eventually = require('./eventually'); + +const Key = lanthan.Key; + +const newApp = () => { + let app = express(); + + app.get('/', (req, res) => { + res.send(` + + hello +`); + }); + + app.get('/follow-input', (req, res) => { + res.send(` + + +`); + }); + + app.get('/area', (req, res) => { + res.send(` + + + + + + + + + +`); + }); + + /* + * test case: link2 is out of the viewport + * +-----------------+ + * | [link1] |<--- window + * | | + * |=================|<--- viewport + * | [link2] | + * | | + * +-----------------+ + */ + app.get('/test1', (req, res) => { + res.send(` + + +
link1
+
+
link2
+ +`); + }); + +/* + * test case 2: link2 and link3 are out of window of the frame + * +-----------------+ + * | +-----------+ | + * | | [link1] | | + * |=================| + * | | [link2] | | + * | +-----------+ | + * | | + * +-----------------+ + */ + app.get('/test2', (req, res) => { + res.send(` + +