@salla.sa/twilight-components
Version:
Salla Web Component
46 lines (45 loc) • 1.47 kB
JavaScript
/*!
* Crafted with ❤ by Salla
*/
import { newE2EPage } from "@stencil/core/testing";
describe('salla-installment-e2e', () => {
let page;
let element;
beforeEach(async () => {
page = await newE2EPage({
html: `<salla-installment></salla-installment>`
});
element = await page.find('salla-installment');
});
it('should render the component', async () => {
expect(element).not.toBeNull();
});
/**
* The following tests assume the [tamaraIsActive] variable it true.
*/
it('should work for price prop', async () => {
await page.$eval("salla-installment", elm => {
elm.price = "1234.23";
});
await page.waitForChanges();
const tamara = await element.find(".tamara-product-widget");
expect(tamara.getAttribute('data-price')).toBe('1234.23');
});
it('should work for language prop', async () => {
await page.$eval("salla-installment", elm => {
elm.language = "EN";
});
await page.waitForChanges();
const tamara = await element.find(".tamara-product-widget");
expect(tamara.getAttribute('data-lang')).toBe('EN');
});
it('should work for currency prop', async () => {
await page.$eval("salla-installment", elm => {
elm.currency = "USD";
});
await page.waitForChanges();
const tamara = await element.find(".tamara-product-widget");
expect(tamara.getAttribute('data-currency')).toBe('USD');
});
});
//# sourceMappingURL=salla-installment.e2e.js.map