diff options
author | alexwl <alexey.a.kiryushin@gmail.com> | 2018-10-02 13:17:04 +0300 |
---|---|---|
committer | alexwl <alexey.a.kiryushin@gmail.com> | 2018-10-02 13:17:04 +0300 |
commit | cf2c56c7061b7ed40fdd3b40a352ddb9c9b7371f (patch) | |
tree | b1de9ada0f1b1cb064e3a9e0d4042d1f519085bd /javascript/tests/acceptance/haskell-module-test.js |
Initial commit
Diffstat (limited to 'javascript/tests/acceptance/haskell-module-test.js')
-rw-r--r-- | javascript/tests/acceptance/haskell-module-test.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/javascript/tests/acceptance/haskell-module-test.js b/javascript/tests/acceptance/haskell-module-test.js new file mode 100644 index 0000000..939c0dd --- /dev/null +++ b/javascript/tests/acceptance/haskell-module-test.js @@ -0,0 +1,28 @@ +import { module, test } from 'qunit'; +import { visit, currentURL, find } from '@ember/test-helpers'; +import { setupApplicationTest } from 'ember-qunit'; + + +module('Acceptance | haskell-module', function(hooks) { + setupApplicationTest(hooks); + + //Test data is in 'server/mocks/packages.js' + test('visiting /package/test-package-0.1.0.0/show/app/Main.hs', async function(assert) { + await visit('/package/test-package-0.1.0.0/show/app/Main.hs'); + + assert.equal(currentURL(), '/package/test-package-0.1.0.0/show/app/Main.hs'); + + const lines = Array.from(find('tbody').children).map((tr) => { + return tr.children[1].innerText; + }); + + assert.deepEqual(lines,["module Main where", + "", + "import Lib", + "", + "main :: IO ()", + "main = someFunc", + "", + ""]); + }); +}); |