Remove Faker (#13778)

* removes faker

* attempts to fix global error in circle ci run

* adds comments for destroyed check in file-to-array-buffer component
This commit is contained in:
Jordan Reimer 2022-01-25 13:27:26 -07:00 committed by GitHub
parent 978311fee2
commit 8786b6fd08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 17 additions and 28 deletions

View File

@ -29,7 +29,11 @@ export default Component.extend({
readFile(file) {
const reader = new FileReader();
reader.onload = () => this.send('onChange', reader.result, file);
// raft-snapshot-restore test was failing on CI trying to send action on destroyed object
// ensure that the component has not been torn down prior to sending onChange action
if (!this.isDestroyed && !this.isDestroying) {
reader.onload = () => this.send('onChange', reader.result, file);
}
reader.readAsArrayBuffer(file);
},

View File

@ -1,13 +1,12 @@
import { Factory, trait } from 'ember-cli-mirage';
import faker from 'faker';
export default Factory.extend({
auth: null,
data: null, // populated via traits
lease_duration: 0,
lease_id: '',
renewable: () => faker.datatype.boolean(),
request_id: () => faker.datatype.uuid(),
renewable: true,
request_id: '22068a49-a504-41ad-b5b0-1eac71659190',
warnings: null,
wrap_info: null,

View File

@ -1,30 +1,19 @@
import { Factory } from 'ember-cli-mirage';
import faker from 'faker';
import { supportedSecretBackends } from 'vault/helpers/supported-secret-backends';
export default Factory.extend({
path: () => faker.system.directoryPath(),
description: () => faker.git.commitMessage(),
local: () => faker.datatype.boolean(),
sealWrap: () => faker.datatype.boolean(),
path: 'foo/',
description: 'secret-engine generated by mirage',
local: true,
sealWrap: true,
// set in afterCreate
accessor: null,
type: null,
accessor: 'type_7f52940',
type: 'kv',
options: null,
afterCreate(secretEngine) {
if (!secretEngine.type) {
const type = faker.random.arrayElement(supportedSecretBackends());
secretEngine.type = type;
if (!secretEngine.accessor) {
secretEngine.accessor = `type_${faker.git.shortSha()}`;
}
}
if (!secretEngine.options && ['generic', 'kv'].includes(secretEngine.type)) {
secretEngine.options = {
version: faker.random.arrayElement('1', '2'),
version: '2',
};
}
},

View File

@ -1,10 +1,9 @@
import { Factory } from 'ember-cli-mirage';
import faker from 'faker';
export default Factory.extend({
address: () => faker.internet.ip(),
address: '127.0.0.1',
node_id: (i) => `raft_node_${i}`,
protocol_version: '3',
voter: () => faker.datatype.boolean(),
leader: () => faker.datatype.boolean(),
voter: true,
leader: true,
});

View File

@ -231,7 +231,6 @@
]
},
"dependencies": {
"faker": "^5.5.3",
"handlebars": "^4.3.0",
"highlight.js": "^10.4.1",
"jquery": "^3.5.0",

View File

@ -4,7 +4,6 @@ module.exports = {
embertest: true,
},
globals: {
faker: true,
server: true,
$: true,
authLogout: false,