From 6fcfb7c04d32e1c8b26a312295bf7ac3ec2d2ad7 Mon Sep 17 00:00:00 2001
From: Marvin Borner
Date: Fri, 13 Jul 2018 19:06:45 +0200
Subject: Fixed many permissions and began admin interface
---
.../select2/tests/selection/containerCss-tests.js | 104 +++++++++++++++++++++
1 file changed, 104 insertions(+)
create mode 100644 public/bower_components/select2/tests/selection/containerCss-tests.js
(limited to 'public/bower_components/select2/tests/selection/containerCss-tests.js')
diff --git a/public/bower_components/select2/tests/selection/containerCss-tests.js b/public/bower_components/select2/tests/selection/containerCss-tests.js
new file mode 100644
index 0000000..522703a
--- /dev/null
+++ b/public/bower_components/select2/tests/selection/containerCss-tests.js
@@ -0,0 +1,104 @@
+module('Dropdown - containerCssClass compatibility');
+
+var $ = require('jquery');
+var Utils = require('select2/utils');
+var Options = require('select2/options');
+
+var SingleSelection = require('select2/selection/single');
+var ContainerCSS = Utils.Decorate(
+ SingleSelection,
+ require('select2/compat/containerCss')
+);
+
+test('all classes will be copied if :all: is used', function (assert) {
+ var $element = $('');
+ var options = new Options({
+ containerCssClass: ':all:'
+ });
+
+ var select = new ContainerCSS($element, options);
+ var $container = select.render();
+
+ assert.ok($container.hasClass('test'));
+ assert.ok($container.hasClass('copy'));
+ assert.ok($container.hasClass('works'));
+ assert.ok(!$container.hasClass(':all:'));
+});
+
+test(':all: can be used with other classes', function (assert) {
+ var $element = $('');
+ var options = new Options({
+ containerCssClass: ':all: other'
+ });
+
+ var select = new ContainerCSS($element, options);
+ var $container = select.render();
+
+ assert.ok($container.hasClass('test'));
+ assert.ok($container.hasClass('copy'));
+ assert.ok($container.hasClass('works'));
+ assert.ok($container.hasClass('other'));
+ assert.ok(!$container.hasClass(':all:'));
+});
+
+test('classes can be passed in as a string', function (assert) {
+ var $element = $('');
+ var options = new Options({
+ containerCssClass: 'other'
+ });
+
+ var select = new ContainerCSS($element, options);
+ var $container = select.render();
+
+ assert.ok($container.hasClass('other'));
+});
+
+test('a function can be used based on the element', function (assert){
+ var $element = $('');
+ var options = new Options({
+ containerCssClass: function ($element) {
+ return 'function';
+ }
+ });
+
+ var select = new ContainerCSS($element, options);
+ var $container = select.render();
+
+ assert.ok($container.hasClass('function'));
+ assert.ok(!$container.hasClass('test'));
+});
+
+test(':all: works around custom adapters', function (assert) {
+ var $element = $('');
+ var options = new Options({
+ containerCssClass: ':all: something',
+ adaptContainerCssClass: function (clazz) {
+ return clazz + '-modified';
+ }
+ });
+
+ var select = new ContainerCSS($element, options);
+ var $container = select.render();
+
+ assert.ok($container.hasClass('something'));
+
+ assert.ok($container.hasClass('test'));
+ assert.ok($container.hasClass('test-modified'));
+});
+
+module('Selection - adaptContainerCss compatibility');
+
+test('only return when adapted', function (assert) {
+ var $element = $('');
+ var options = new Options({
+ adaptContainerCssClass: function (clazz) {
+ return 'modified';
+ }
+ });
+
+ var select = new ContainerCSS($element, options);
+ var $container = select.render();
+
+ assert.ok(!$container.hasClass('original'));
+ assert.ok($container.hasClass('modified'));
+});
--
cgit v1.2.3