entityHtmlDisplay.mjs 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. import { describe, it, before, after, afterEach } from 'mocha'
  2. import { expect } from 'chai'
  3. import { By } from 'selenium-webdriver'
  4. import {
  5. getRootAndWait,
  6. takeScreenshotOnFailure,
  7. waitForDashboardLoaded,
  8. } from '../../lib/elements.js'
  9. describe('config: entityHtmlDisplay', function () {
  10. before(async function () {
  11. await runner.start('entityHtmlDisplay')
  12. })
  13. after(async () => {
  14. await runner.stop()
  15. })
  16. afterEach(function () {
  17. takeScreenshotOnFailure(this.currentTest, webdriver)
  18. })
  19. it('renders entity HTML content inside display components (#804)', async function () {
  20. await getRootAndWait()
  21. await webdriver.get(runner.baseUrl() + 'dashboards/Html%20Display%20Dashboard')
  22. await waitForDashboardLoaded()
  23. const contentDiv = await webdriver.findElements(By.css('.display.test-html-display .content'))
  24. expect(contentDiv).to.have.length.at.least(1, 'Entity HTML should render inside the display component')
  25. const text = await contentDiv[0].getText()
  26. expect(text).to.equal('entity-html-test')
  27. })
  28. })