[
  {
    "tags": [],
    "description": {
      "full": "",
      "summary": "",
      "body": ""
    },
    "isPrivate": false,
    "isConstructor": false,
    "line": 1,
    "codeStart": null,
    "code": "import 'reflect-metadata';\nimport 'aurelia-polyfills';\n\nimport {bootstrap}      from 'aurelia-bootstrapper';\nimport {newComponent}         from \"test/render\";\n\n\nlet component : any;\n\n\nfunction initialize(bindingContext : any, templateString ?: string) {\n    let template = templateString ? templateString : `\n  aire-select(label.bind=\"textLabel\" data.bind=\"options\")\n  `;\n    component = newComponent(template, bindingContext, 'form/select');\n}\n\nafterEach(() => {\n    component.dispose();\n});\n\ntest(\"a select should initialize\", async (done) => {\n    initialize({textLabel : \"Hello\"});\n    await component.create(bootstrap);\n    let select = document.querySelector('select.uk-select');\n    expect(select).toBeTruthy();\n    done();\n});\n\ntest(\"a label should not initialize if not present in binding context\", async (done) => {\n    initialize({});\n    await component.create(bootstrap);\n    let label = document.querySelector('label.uk-form-label');\n    expect(label).toBeFalsy();\n    done();\n});\n\ntest(\"a label should initialize if present in binding context\", async (done) => {\n    initialize({textLabel : \"Hello\"});\n    await component.create(bootstrap);\n    let label = document.querySelector('label.uk-form-label');\n    expect(label).toBeTruthy();\n    done();\n});\n\ntest(\"a label should be for a select\", async (done) => {\n    initialize({textLabel : \"Hello\"});\n    await component.create(bootstrap);\n    let label = document.querySelector('label.uk-form-label') as HTMLLabelElement,\n        select = document.querySelector('select.uk-select') as HTMLSelectElement;\n    expect(label.htmlFor).toBe(select.id);\n    done();\n});\n\ntest.skip(\"a select should take an array of objects with labels and values\", async (done) => {\n    initialize({options: [{label: \"Thing One\", value: \"One\"}, {label: \"Thing Two\", Value: \"Two\"}]});\n    await component.create(bootstrap);\n    let options = document.querySelectorAll('select.uk-select option'),\n    option1 = document.querySelector('option[value=\"One\"]');\n    expect(options.length).toBe(2);\n    expect(option1.textContent).toBe(\"Thing One\");\n    done();\n});\n\ntest.skip(\"a select should take a single object with a label and value\", async (done) => {\n    initialize({options: {label: \"Thing One\", value: \"One\"}});\n    await component.create(bootstrap);\n    let options = document.querySelectorAll('select.uk-select option'),\n        option1 = document.querySelector('option[value=\"One\"]');\n    expect(options.length).toBe(1);\n    expect(option1.textContent).toBe(\"Thing One\");\n    done();\n});\n\ntest(\"a select should go disabled when true in binding context\", async (done) => {\n    initialize({textLabel : \"Hello\", disabled : \"true\"}, `\naire-select(label.bind=\"textLabel\" disabled.bind=\"disabled\")\n  `);\n    await component.create(bootstrap);\n    let select = document.querySelector('select') as HTMLSelectElement;\n    expect(select.disabled).toBeTruthy();\n    done();\n});\n\ntest(\"a select should not go disabled when false in binding context\", async (done) => {\n    initialize({textLabel : \"Hello\", disabled : \"false\"}, `\naire-select(label.bind=\"textLabel\" disabled.bind=\"disabled\")\n  `);\n    await component.create(bootstrap);\n    let select = document.querySelector('select') as HTMLSelectElement;\n    expect(select.disabled).toBeTruthy();\n    done();\n});\n\ntest(\"a select should not go disabled when not in binding context\", async (done) => {\n    initialize({textLabel : \"Hello\"}, `\naire-select(label.bind=\"textLabel\")\n  `);\n    await component.create(bootstrap);\n    let select = document.querySelector('select') as HTMLSelectElement;\n    expect(select.disabled).toBeFalsy();\n    done();\n});\n\ntest(\"a select can take a horizontal argument\", async(done) => {\n    initialize({textLabel: \"Henlo\"}, `\naire-select(label.bind=\"textLabel\" horizontal)\n  `);\n    await component.create(bootstrap);\n    let select = document.querySelector('.uk-form-horizontal');\n    expect(select).toBeTruthy();\n    done();\n});\n\ntest(\"a select can take a success argument\", async(done) => {\n    initialize({textLabel: \"Henlo\"}, `\naire-select(label.bind=\"textLabel\" success)\n  `);\n    await component.create(bootstrap);\n    let select = document.querySelector('select.uk-form-success');\n    expect(select).toBeTruthy();\n    done();\n});\n\ntest(\"a select can take a danger argument\", async(done) => {\n    initialize({textLabel: \"Henlo\"}, `\naire-select(label.bind=\"textLabel\" danger)\n  `);\n    await component.create(bootstrap);\n    let select = document.querySelector('select.uk-form-danger');\n    expect(select).toBeTruthy();\n    done();\n});\n\ntest(\"a select can take a blank argument\", async(done) => {\n    initialize({textLabel: \"Henlo\"}, `\naire-select(label.bind=\"textLabel\" blank)\n  `);\n    await component.create(bootstrap);\n    let select = document.querySelector('select.uk-form-blank');\n    expect(select).toBeTruthy();\n    done();\n});",
    "ctx": false
  }
]