Skip to content

Commit

Permalink
Add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mickeynp committed Sep 11, 2024
1 parent 592ddc9 commit aca976e
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/fixtures/mc-edit/sequence.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// -*- combobulate-test-point-overlays: ((1 outline 192) (2 outline 228)); eval: (combobulate-test-fixture-mode t); -*-
import React from 'react';


const Something = () => {
return (
<div>
<h1>Something</h1>
</div>
)
}
6 changes: 6 additions & 0 deletions tests/fixtures/sequence/element.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!-- -*- combobulate-test-point-overlays: ((1 outline 136) (2 outline 172)); eval: (combobulate-test-fixture-mode t); -*- -->
<div>
<span class="foo">
Text here
</span>
</div>
8 changes: 8 additions & 0 deletions tests/fixtures/sequence/jsx.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// -*- combobulate-test-point-overlays: ((1 outline 176) (2 outline 192)); eval: (combobulate-test-fixture-mode t); -*-
const HelloWorld = () => {
return (
<div>
<h1>Hello World</h1>
</div>
);
};
15 changes: 15 additions & 0 deletions tests/generate-harnesses.el
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,21 @@
(combobulate-kill-node-dwim))))
:per-marker nil
:reverse nil)
;; Sequence navigation
(combobulate-test-suite
:harness-factory #'combobulate-test-harness-marker-loop
:fixture-files "fixtures/sequence/*"
:collection-name "combobulate-navigate-sequence-previous"
:action-body '((combobulate-navigate-sequence-previous))
:per-marker nil
:reverse t)
(combobulate-test-suite
:harness-factory #'combobulate-test-harness-marker-loop
:fixture-files "fixtures/sequence/*"
:collection-name "combobulate-navigate-sequence-next"
:action-body '((combobulate-navigate-sequence-next))
:per-marker nil
:reverse nil)
;; Sibling navigation
(combobulate-test-suite
:harness-factory #'combobulate-test-harness-marker-loop
Expand Down
28 changes: 28 additions & 0 deletions tests/test-combobulate-navigate-sequence-next.gen.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
;; This file is generated auto generated. Do not edit directly.

(require 'combobulate)

(require 'combobulate-test-prelude)

(ert-deftest combobulate-test-html-combobulate-navigate-sequence-next--element-2 ()
"Test `combobulate' with `fixtures/sequence/element.html' in `html-ts-mode' mode."
(combobulate-test
(:language html :mode html-ts-mode :fixture "fixtures/sequence/element.html")
:tags
'(combobulate html html-ts-mode combobulate-navigate-sequence-next)
(should-error
(progn
(combobulate-navigate-sequence-next)))))


(ert-deftest combobulate-test-tsx-combobulate-navigate-sequence-next--jsx-2 ()
"Test `combobulate' with `fixtures/sequence/jsx.tsx' in `tsx-ts-mode' mode."
(combobulate-test
(:language tsx :mode tsx-ts-mode :fixture "fixtures/sequence/jsx.tsx")
:tags
'(combobulate tsx tsx-ts-mode combobulate-navigate-sequence-next)
(should-error
(progn
(combobulate-navigate-sequence-next)))))


28 changes: 28 additions & 0 deletions tests/test-combobulate-navigate-sequence-previous.gen.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
;; This file is generated auto generated. Do not edit directly.

(require 'combobulate)

(require 'combobulate-test-prelude)

(ert-deftest combobulate-test-html-combobulate-navigate-sequence-previous--element-1 ()
"Test `combobulate' with `fixtures/sequence/element.html' in `html-ts-mode' mode."
(combobulate-test
(:language html :mode html-ts-mode :fixture "fixtures/sequence/element.html")
:tags
'(combobulate html html-ts-mode combobulate-navigate-sequence-previous)
(combobulate-test-go-to-marker 1)
(combobulate-navigate-sequence-previous)
(combobulate-test-assert-at-marker 1)))


(ert-deftest combobulate-test-tsx-combobulate-navigate-sequence-previous--jsx-1 ()
"Test `combobulate' with `fixtures/sequence/jsx.tsx' in `tsx-ts-mode' mode."
(combobulate-test
(:language tsx :mode tsx-ts-mode :fixture "fixtures/sequence/jsx.tsx")
:tags
'(combobulate tsx tsx-ts-mode combobulate-navigate-sequence-previous)
(combobulate-test-go-to-marker 1)
(combobulate-navigate-sequence-previous)
(combobulate-test-assert-at-marker 1)))


0 comments on commit aca976e

Please sign in to comment.