Skip to content
Snippets Groups Projects
Select Git revision
  • 7631413f5b9b069164dd05966fc930d418b7ebd9
  • master default protected
  • v1.23.2
  • v1.23.1
  • v1.23.0
  • v1.22.0
  • v1.21.1
  • v1.21.0
  • v1.20.3
  • v1.20.2
  • v1.20.1
  • v1.20.0
  • v1.19.4
  • v1.19.3
  • v1.19.2
  • v1.19.1
  • v1.19.0
  • v1.18.2
  • v1.18.1
  • v1.18.0
  • v1.17.0
  • v1.16.1
22 results

runnable-sftp_test.go

Blame
  • stylesheet.mjs 2.65 KiB
    'use strict';
    
    import * as chai from 'chai';
    import {Stylesheet} from "../../../../../source/dom/resource/link/stylesheet.mjs";
    import {DataUrl} from "../../../../../source/types/dataurl.mjs";
    import {ID} from "../../../../../source/types/id.mjs";
    import {chaiDom} from "../../../../util/chai-dom.mjs";
    import {cleanupDOMFromTesting, initMutationObserverForTesting} from "../../../../util/cleanupdom.mjs";
    import {initJSDOM} from "../../../../util/jsdom.mjs";
    
    let expect = chai.expect;
    
    chai.use(chaiDom);
    
    let html1 = `
    
    `;
    
    
    describe('Stylesheet', function () {
    
        before(function (done) {
            initJSDOM({
                runScripts: "dangerously",
                resources: "usable"
            }).then(() => {
                done()
            }).catch(e => done(e));
        });
    
        beforeEach(() => {
            initMutationObserverForTesting()
        })
    
        afterEach(() => {
            cleanupDOMFromTesting();
        })
    
        describe('Stylesheet()', function () {
            it('connect().available()', function (done) {
    
                const stylesheet = new Stylesheet({
                    href: new DataUrl('', 'text/css').toString(),
                });
    
                stylesheet.connect().available().then(() => {
                    const id = stylesheet.getOption('id')
                    done()
                }).catch(e => done(e));
    
            })
        });
    
        describe('External Stylesheet', () => {
    
            let id = new ID('Stylesheet').toString();
            let stylesheet, url = 'https://alvine.io/main.min.css';
    
            beforeEach(() => {
    
                stylesheet = new Stylesheet({
                    href: url,
                    id: id,
                });
    
            });
    
            it('append and remove Stylesheet ', (done) => {
    
                expect(stylesheet.isConnected()).to.be.false;