mirror of https://github.com/sveltejs/svelte
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.0 KiB
46 lines
1.0 KiB
5 years ago
|
export default {
|
||
|
props: {
|
||
|
testName1: "test1",
|
||
|
testName2: "test2",
|
||
|
},
|
||
|
|
||
5 years ago
|
html: `<div class="test1test2"></div>`,
|
||
5 years ago
|
|
||
|
test({ assert, component, target }) {
|
||
|
const div = target.querySelector('div');
|
||
5 years ago
|
assert.equal(div.className, 'test1test2');
|
||
5 years ago
|
|
||
|
component.testName1 = null;
|
||
|
component.testName2 = null;
|
||
5 years ago
|
assert.equal(div.className, '0');
|
||
5 years ago
|
|
||
|
component.testName1 = null;
|
||
|
component.testName2 = "test";
|
||
5 years ago
|
assert.equal(div.className, 'nulltest');
|
||
5 years ago
|
|
||
|
component.testName1 = undefined;
|
||
|
component.testName2 = "test";
|
||
5 years ago
|
assert.equal(div.className, 'undefinedtest');
|
||
5 years ago
|
|
||
|
component.testName1 = undefined;
|
||
|
component.testName2 = undefined;
|
||
5 years ago
|
assert.equal(div.className, 'NaN');
|
||
5 years ago
|
|
||
|
component.testName1 = null;
|
||
|
component.testName2 = 1;
|
||
5 years ago
|
assert.equal(div.className, '1');
|
||
5 years ago
|
|
||
|
component.testName1 = undefined;
|
||
|
component.testName2 = 1;
|
||
5 years ago
|
assert.equal(div.className, 'NaN');
|
||
|
|
||
|
component.testName1 = null;
|
||
|
component.testName2 = 0;
|
||
|
assert.equal(div.className, '0');
|
||
|
|
||
|
component.testName1 = undefined;
|
||
|
component.testName2 = 0;
|
||
|
assert.equal(div.className, 'NaN');
|
||
5 years ago
|
}
|
||
|
};
|