Skip to content

Commit

Permalink
test: smalltalk: rm duplicate
Browse files Browse the repository at this point in the history
  • Loading branch information
coderaiser committed Jul 12, 2022
1 parent ca7098b commit 1ac9c67
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 51 deletions.
2 changes: 1 addition & 1 deletion .madrun.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default {
'fresh:lint': () => run('lint', '--fresh'),
'lint:fresh': () => run('lint', '--fresh'),
'fix:lint': () => run('lint', '--fix'),
'test': () => `tape 'test/**/*.js'`,
'test': () => `tape --no-check-scopes 'test/**/*.js'`,
'test:update': () => 'UPDATE_FIXTURE=1 npm test',
'build': () => 'webpack --progress --mode production',
'wisdom': () => run('build'),
Expand Down
51 changes: 1 addition & 50 deletions test/smalltalk.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,55 +169,6 @@ test('smalltalk: alert: keydown: stopPropagation', (t, {document}) => {
t.end();
});

test('smalltalk: alert: keydown: tab: preventDefault', (t, {document}) => {
const parentElement = create();
const {
createElement,
querySelector,
activeElement,
} = document;

const el = {
...create(),
parentElement,
querySelector: (a) => {
if (a === '[data-name="js-ok"]')
return ok;
},
};

activeElement.getAttribute.returns('js-ok');

const ok = {
getAttribute: () => 'js-ok',
focus: stub(),
addEventListener: stub(),
};

createElement.returns(el);
querySelector.returns(el);

smalltalk.alert('title', 'message');

const [, keydown] = el.addEventListener.args
.filter(([event]) => event === 'keydown')
.pop();

const TAB = 9;

const event = {
keyCode: TAB,
preventDefault: stub(),
stopPropagation: stub(),
target: el,
};

keydown(event);

t.ok(event.preventDefault.called, 'should call preventDefault');
t.end();
});

test('smalltalk: alert: click: stopPropagation: called', (t, {document}) => {
const {
createElement,
Expand Down Expand Up @@ -403,7 +354,7 @@ test('smalltalk: alert: keydown: left: focus', (t) => {
t.end();
});

test('smalltalk: alert: click', (t, {document}) => {
test('smalltalk: alert: click: focus', (t, {document}) => {
const {
createElement,
querySelector,
Expand Down

0 comments on commit 1ac9c67

Please sign in to comment.