UNPKG

@salla.sa/twilight-components

Version:
46 lines (45 loc) 1.48 kB
/*! * Crafted with ❤ by Salla */ import { newSpecPage } from "@stencil/core/testing"; import { SallaSearch } from "../salla-search"; describe('salla search', () => { it('should build', () => { expect(new SallaSearch()).toBeTruthy(); }); describe('checking for props', () => { let page; let element; beforeEach(async () => { page = await newSpecPage({ components: [SallaSearch], html: '<salla-search></salla-search>' }); element = await page.doc.querySelector('salla-search'); }); it('should work for height prop', async () => { element.height = 60; await page.waitForChanges(); expect(element.height).toBe(60); }); it("should work for oval prop", async () => { element.oval = false; await page.waitForChanges(); expect(element.oval).toBe(false); }); it("should work for inline prop", async () => { element.inline = false; await page.waitForChanges(); expect(element.inline).toBe(false); }); it("should let user enter text into the input", async () => { //@ts-ignore const searchField = await page.doc.querySelector('.s-search-input'); searchField.value = "salla"; await page.waitForChanges(); const placeholder = await page.doc.querySelector('.s-search-no-results-placeholder'); expect(placeholder.getAttribute('hidden')).toBeNull(); }); }); }); //# sourceMappingURL=salla-search.spec.js.map