1 |
|
2 |
|
3 | const tymly = require('./../lib')
|
4 | const path = require('path')
|
5 | const expect = require('chai').expect
|
6 |
|
7 | describe('Category tests', function () {
|
8 | this.timeout(process.env.TIMEOUT || 5000)
|
9 |
|
10 | let tymlyService
|
11 | let categoryService
|
12 |
|
13 | before('load the cat blueprint (which has some registry keys)', async () => {
|
14 | const tymlyServices = await tymly.boot({
|
15 | blueprintPaths: [
|
16 | path.resolve(__dirname, './fixtures/blueprints/cats-blueprint')
|
17 | ],
|
18 |
|
19 | pluginPaths: [
|
20 | path.resolve(__dirname, './fixtures/plugins/cats-plugin')
|
21 | ]
|
22 | })
|
23 |
|
24 | tymlyService = tymlyServices.tymly
|
25 | categoryService = tymlyServices.categories
|
26 | })
|
27 |
|
28 | it('check cat tag', () => {
|
29 | expect(categoryService.categories.cat).to.eql(
|
30 | {
|
31 | category: 'cat',
|
32 | label: 'Cat',
|
33 | styling: {
|
34 | 'background-color': '#5F5F5F'
|
35 | }
|
36 | }
|
37 | )
|
38 | })
|
39 |
|
40 | it('check pet tag', () => {
|
41 | expect(categoryService.categories.pet).to.eql(
|
42 | {
|
43 | category: 'pet',
|
44 | label: 'Pet',
|
45 | styling: {
|
46 | 'background-color': '#80C342'
|
47 | }
|
48 | }
|
49 | )
|
50 | })
|
51 |
|
52 | after('shutdown Tymly', async () => {
|
53 | await tymlyService.shutdown()
|
54 | })
|
55 | })
|