mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-18 23:09:49 +02:00
add journey tests for accDescription
This commit is contained in:
@@ -36,6 +36,7 @@ describe('when using the journeyDb', function () {
|
|||||||
fn | expected
|
fn | expected
|
||||||
${'getTasks'} | ${[]}
|
${'getTasks'} | ${[]}
|
||||||
${'getTitle'} | ${''}
|
${'getTitle'} | ${''}
|
||||||
|
${'getAccDescription'} | ${''}
|
||||||
${'getSections'} | ${[]}
|
${'getSections'} | ${[]}
|
||||||
`('should clear $fn', ({ fn, expected }) => {
|
`('should clear $fn', ({ fn, expected }) => {
|
||||||
expect(journeyDb[fn]()).toEqual(expected);
|
expect(journeyDb[fn]()).toEqual(expected);
|
||||||
@@ -44,6 +45,7 @@ describe('when using the journeyDb', function () {
|
|||||||
|
|
||||||
describe('tasks and actors should be added', function () {
|
describe('tasks and actors should be added', function () {
|
||||||
journeyDb.setTitle('Shopping');
|
journeyDb.setTitle('Shopping');
|
||||||
|
journeyDb.setAccDescription('A user journey for family shopping');
|
||||||
journeyDb.addSection('Journey to the shops');
|
journeyDb.addSection('Journey to the shops');
|
||||||
journeyDb.addTask('Get car keys', ':5:Dad');
|
journeyDb.addTask('Get car keys', ':5:Dad');
|
||||||
journeyDb.addTask('Go to car', ':3:Dad, Mum, Child#1, Child#2');
|
journeyDb.addTask('Go to car', ':3:Dad, Mum, Child#1, Child#2');
|
||||||
@@ -52,6 +54,7 @@ describe('when using the journeyDb', function () {
|
|||||||
journeyDb.addTask('Go shopping', ':5:Mum');
|
journeyDb.addTask('Go shopping', ':5:Mum');
|
||||||
|
|
||||||
expect(journeyDb.getTitle()).toEqual('Shopping');
|
expect(journeyDb.getTitle()).toEqual('Shopping');
|
||||||
|
expect(journeyDb.getAccDescription()).toEqual('A user journey for family shopping');
|
||||||
expect(journeyDb.getTasks()).toEqual([
|
expect(journeyDb.getTasks()).toEqual([
|
||||||
{
|
{
|
||||||
score: 5,
|
score: 5,
|
||||||
|
@@ -19,6 +19,16 @@ describe('when parsing a journey diagram it', function () {
|
|||||||
expect(parserFnConstructor(str)).not.toThrow();
|
expect(parserFnConstructor(str)).not.toThrow();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('it should handle an accDescription', function () {
|
||||||
|
const str =
|
||||||
|
'journey\n' +
|
||||||
|
'accDescription A user journey for family shopping\n'+
|
||||||
|
'title Adding journey diagram functionality to mermaid\n' +
|
||||||
|
'section Order from website';
|
||||||
|
|
||||||
|
expect(parserFnConstructor(str)).not.toThrow();
|
||||||
|
});
|
||||||
|
|
||||||
it('should handle a section definition', function () {
|
it('should handle a section definition', function () {
|
||||||
const str =
|
const str =
|
||||||
'journey\n' +
|
'journey\n' +
|
||||||
|
Reference in New Issue
Block a user