-
-
Notifications
You must be signed in to change notification settings - Fork 101
Expand file tree
/
Copy pathdasherize_test.js
More file actions
36 lines (34 loc) · 1.02 KB
/
dasherize_test.js
File metadata and controls
36 lines (34 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { module } from 'qunit';
import { dasherize } from 'ember-resolver/string/index';
import createTestFunction from '../helpers/create-test-function';
module('dasherize', function () {
const test = createTestFunction(dasherize);
test('my favorite items', 'my-favorite-items', 'dasherize normal string');
test(
'css-class-name',
'css-class-name',
'does nothing with dasherized string'
);
test('action_name', 'action-name', 'dasherize underscored string');
test('innerHTML', 'inner-html', 'dasherize camelcased string');
test(
'toString',
'to-string',
'dasherize string that is the property name of Object.prototype'
);
test(
'PrivateDocs/OwnerInvoice',
'private-docs/owner-invoice',
'dasherize namespaced classified string'
);
test(
'privateDocs/ownerInvoice',
'private-docs/owner-invoice',
'dasherize namespaced camelized string'
);
test(
'private_docs/owner_invoice',
'private-docs/owner-invoice',
'dasherize namespaced underscored string'
);
});