From 4677b52e319a2c61dd3311b4f51ac45d32594417 Mon Sep 17 00:00:00 2001 From: Chris Manson Date: Fri, 5 Jul 2024 14:03:51 +0100 Subject: [PATCH] remove markup tests since we don't process markup any more --- test/markup-test.js | 58 ----------------- test/mocks/description/handlebars-title.html | 65 -------------------- test/mocks/description/handlebars-title.md | 21 ------- test/mocks/description/handlebars.html | 60 ------------------ test/mocks/description/handlebars.md | 21 ------- test/mocks/description/javascript-title.html | 35 ----------- test/mocks/description/javascript-title.md | 10 --- test/mocks/description/javascript.html | 30 --------- test/mocks/description/javascript.md | 10 --- 9 files changed, 310 deletions(-) delete mode 100644 test/markup-test.js delete mode 100644 test/mocks/description/handlebars-title.html delete mode 100644 test/mocks/description/handlebars-title.md delete mode 100644 test/mocks/description/handlebars.html delete mode 100644 test/mocks/description/handlebars.md delete mode 100644 test/mocks/description/javascript-title.html delete mode 100644 test/mocks/description/javascript-title.md delete mode 100644 test/mocks/description/javascript.html delete mode 100644 test/mocks/description/javascript.md diff --git a/test/markup-test.js b/test/markup-test.js deleted file mode 100644 index 7cc2be9..0000000 --- a/test/markup-test.js +++ /dev/null @@ -1,58 +0,0 @@ -import markup from '../lib/markup.js'; -import { assert } from 'chai'; -import fs from 'fs'; - -function desc(path) { - return { - id: Date.now(), - attributes: { - description: fs.readFileSync(`./test/mocks/description/${path}.md`, 'utf-8'), - methods: [], - properties: [], - events: [], - }, - }; -} - -function mark(path) { - let data = [desc(path)]; - let result = markup({ data }); - let content = result.data[0].attributes.description; - maybeWrite(content, path); - return content; -} - -function maybeWrite(content, path) { - const fsPath = `./test/mocks/description/${path}.html`; - if (fs.existsSync(fsPath)) { - return; - } - fs.writeFileSync(fsPath, content, 'utf-8'); -} - -function snapshot(path) { - const fsPath = `./test/mocks/description/${path}.html`; - return fs.readFileSync(fsPath, 'utf8'); -} - -describe('markup', () => { - it('render correct syntax for handlebars with title', function () { - const caseName = 'handlebars-title'; - assert.equal(mark(caseName), snapshot(caseName)); - }); - - it('render correct syntax for handlebars without title', function () { - const caseName = 'handlebars'; - assert.equal(mark(caseName), snapshot(caseName)); - }); - - it('render correct syntax for javascript with title', function () { - const caseName = 'javascript-title'; - assert.equal(mark(caseName), snapshot(caseName)); - }); - - it('render correct syntax for javascript without title', function () { - const caseName = 'javascript'; - assert.equal(mark(caseName), snapshot(caseName)); - }); -}); diff --git a/test/mocks/description/handlebars-title.html b/test/mocks/description/handlebars-title.html deleted file mode 100644 index 4ef6725..0000000 --- a/test/mocks/description/handlebars-title.html +++ /dev/null @@ -1,65 +0,0 @@ -
-
-
- - - - - - - - - - - - -
profile.hbs
1
-2
-3
-
  <h1>{{person.title}}</h1>
-  {{! Executed in the component's context. }}
-  {{yield}} {{! block contents }}
-
-
- -

If you want to customize the component, in order to - handle events or actions, you implement a subclass - of Ember.Component named after the name of the - component. - For example, you could implement the action - hello for the person-profile component:

-
-
-
- - - - - - - - - - - - -
profile.js
1
-2
-3
-4
-5
-6
-7
-8
-
import Ember from 'ember';
-export default Ember.Component.extend({
-  actions: {
-    hello(name) {
-      console.log("Hello", name);
-    }
-  }
-});
-
-
- - \ No newline at end of file diff --git a/test/mocks/description/handlebars-title.md b/test/mocks/description/handlebars-title.md deleted file mode 100644 index 5e60961..0000000 --- a/test/mocks/description/handlebars-title.md +++ /dev/null @@ -1,21 +0,0 @@ -```app/components/person-profile.hbs -

{{person.title}}

- {{! Executed in the component's context. }} - {{yield}} {{! block contents }} - ``` - If you want to customize the component, in order to - handle events or actions, you implement a subclass - of `Ember.Component` named after the name of the - component. - For example, you could implement the action - `hello` for the `person-profile` component: - ```app/components/person-profile.js - import Ember from 'ember'; - export default Ember.Component.extend({ - actions: { - hello(name) { - console.log("Hello", name); - } - } - }); -``` diff --git a/test/mocks/description/handlebars.html b/test/mocks/description/handlebars.html deleted file mode 100644 index 9464fde..0000000 --- a/test/mocks/description/handlebars.html +++ /dev/null @@ -1,60 +0,0 @@ -
-
-
- - - - - - - -
1
-2
-3
-
  <h1>{{person.title}}</h1>
-  {{! Executed in the component's context. }}
-  {{yield}} {{! block contents }}
-
-
- -

If you want to customize the component, in order to - handle events or actions, you implement a subclass - of Ember.Component named after the name of the - component. - For example, you could implement the action - hello for the person-profile component:

-
-
-
- - - - - - - - - - - - -
profile.js
1
-2
-3
-4
-5
-6
-7
-8
-
import Ember from 'ember';
-export default Ember.Component.extend({
-  actions: {
-    hello(name) {
-      console.log("Hello", name);
-    }
-  }
-});
-
-
- - \ No newline at end of file diff --git a/test/mocks/description/handlebars.md b/test/mocks/description/handlebars.md deleted file mode 100644 index 93c7b17..0000000 --- a/test/mocks/description/handlebars.md +++ /dev/null @@ -1,21 +0,0 @@ -```hbs -

{{person.title}}

- {{! Executed in the component's context. }} - {{yield}} {{! block contents }} - ``` - If you want to customize the component, in order to - handle events or actions, you implement a subclass - of `Ember.Component` named after the name of the - component. - For example, you could implement the action - `hello` for the `person-profile` component: - ```app/components/person-profile.js - import Ember from 'ember'; - export default Ember.Component.extend({ - actions: { - hello(name) { - console.log("Hello", name); - } - } - }); -``` diff --git a/test/mocks/description/javascript-title.html b/test/mocks/description/javascript-title.html deleted file mode 100644 index 9ff2012..0000000 --- a/test/mocks/description/javascript-title.html +++ /dev/null @@ -1,35 +0,0 @@ -
-
-
- - - - - - - - - - - - -
app/routes/articles.js
1
-2
-3
-4
-5
-6
-7
-8
-
import Route from '@ember/routing/route';
-export default class ArticlesRoute extends Route {
-  resetController(controller, isExiting, transition) {
-    if (isExiting && transition.targetName !== 'error') {
-      controller.set('page', 1);
-    }
-  }
-}
-
-
- - \ No newline at end of file diff --git a/test/mocks/description/javascript-title.md b/test/mocks/description/javascript-title.md deleted file mode 100644 index 6431841..0000000 --- a/test/mocks/description/javascript-title.md +++ /dev/null @@ -1,10 +0,0 @@ -```app/routes/articles.js -import Route from '@ember/routing/route'; -export default class ArticlesRoute extends Route { - resetController(controller, isExiting, transition) { - if (isExiting && transition.targetName !== 'error') { - controller.set('page', 1); - } - } -} -``` diff --git a/test/mocks/description/javascript.html b/test/mocks/description/javascript.html deleted file mode 100644 index d50ee6c..0000000 --- a/test/mocks/description/javascript.html +++ /dev/null @@ -1,30 +0,0 @@ -
-
-
- - - - - - - -
1
-2
-3
-4
-5
-6
-7
-8
-
import Route from '@ember/routing/route';
-export default class ArticlesRoute extends Route {
-  resetController(controller, isExiting, transition) {
-    if (isExiting && transition.targetName !== 'error') {
-      controller.set('page', 1);
-    }
-  }
-}
-
-
- - \ No newline at end of file diff --git a/test/mocks/description/javascript.md b/test/mocks/description/javascript.md deleted file mode 100644 index 46a9f57..0000000 --- a/test/mocks/description/javascript.md +++ /dev/null @@ -1,10 +0,0 @@ -```js -import Route from '@ember/routing/route'; -export default class ArticlesRoute extends Route { - resetController(controller, isExiting, transition) { - if (isExiting && transition.targetName !== 'error') { - controller.set('page', 1); - } - } -} -```