UNPKG

conversation-design-system

Version:

> 💁‍♀️ This repository contains an Assistant to help designers adhere to the conventions in the > Conversation Design System. It defines the following rules...

33 lines (32 loc) 2.54 kB
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const path_1 = require("path"); const sketch_assistant_utils_1 = require("@sketch-hq/sketch-assistant-utils"); const __1 = __importDefault(require("..")); test('test assistant', () => __awaiter(void 0, void 0, void 0, function* () { const { violations, ruleErrors } = yield sketch_assistant_utils_1.testAssistant(path_1.resolve(__dirname, './temp-assistant-test.sketch'), __1.default); expect(violations[0].message).toBe('Layer name does not match any of the allowed patterns'); expect(violations[1].message).toBe('Page “💁‍♂️ component overview” not found.'); expect(violations[2].message).toBe('Fill layer Rectangle (L) should be prefixed with "🎨" (followed by no space).'); expect(violations[3].message).toBe('Text layer label (L) should be prefixed with "✏️" (followed by no space).'); expect(violations[4].message).toBe('Image layer pic (L) should be prefixed with "🖼" (followed by no space).'); expect(violations[5].message).toBe('Icon layer ⚡️ icon 2 (L) should be prefixed with "⚡️" (followed by no space).'); expect(violations[6].message).toBe('Image layer pic should be prefixed with "🖼" (followed by no space).'); expect(violations[7].message).toBe('Fill layer Rectangle should be prefixed with "🎨" (followed by no space).'); expect(violations[8].message).toBe('Icon layer ⚡️ icon 2 should be prefixed with "⚡️" (followed by no space).'); expect(violations[9].message).toBe('Text layer label should be prefixed with "✏️" (followed by no space).'); expect(violations).toHaveLength(10); expect(ruleErrors).toHaveLength(0); }));