-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new_audit: inputs-can-be-pasted-into
- Loading branch information
1 parent
80709e6
commit 93b3ff7
Showing
66 changed files
with
890,527 additions
and
705 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 0 additions & 49 deletions
49
core/gather/gatherers/dobetterweb/password-inputs-with-prevented-paste.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
core/test/audits/dobetterweb/inputs-can-be-pasted-into-test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/** | ||
* @license Copyright 2022 The Lighthouse Authors. All Rights Reserved. | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. | ||
*/ | ||
|
||
import {strict as assert} from 'assert'; | ||
|
||
import InputsCanBePastedIntoAudit from '../../../audits/dobetterweb/inputs-can-be-pasted-into.js'; | ||
|
||
describe('Inputs can be pasted into', () => { | ||
it('passes when there are no inputs preventing paste', () => { | ||
const auditResult = InputsCanBePastedIntoAudit.audit({ | ||
Inputs: { | ||
inputs: [], | ||
}, | ||
}); | ||
assert.equal(auditResult.score, 1); | ||
assert.equal(auditResult.details.items.length, 0); | ||
}); | ||
|
||
it('fails when there are inputs preventing paste', () => { | ||
const auditResult = InputsCanBePastedIntoAudit.audit({ | ||
Inputs: { | ||
inputs: [ | ||
{node: {snippet: 'bad'}, preventsPaste: true}, | ||
{node: {snippet: ''}, preventsPaste: false}, | ||
{node: {snippet: ''}}, | ||
], | ||
}, | ||
}); | ||
assert.equal(auditResult.score, 0); | ||
assert.equal(auditResult.details.items.length, 1); | ||
assert.equal(auditResult.details.items[0].node.snippet, 'bad'); | ||
}); | ||
}); |
28 changes: 0 additions & 28 deletions
28
core/test/audits/dobetterweb/password-inputs-can-be-pasted-into-test.js
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.