0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-17 23:44:39 -05:00

Fixed tests and added fixtures from Ghost repo

This commit is contained in:
Nazar Gargol 2020-06-19 19:23:52 +12:00
parent 320d1f7653
commit 5c47d725cb
4 changed files with 15 additions and 7 deletions

View file

@ -0,0 +1,3 @@
email
jbloggs@example.com
test@example.com
1 email
2 jbloggs@example.com
3 test@example.com

View file

@ -0,0 +1,3 @@
id,Email Address
1,"jbloggs@example.com"
2,test@example.com
1 id Email Address
2 1 jbloggs@example.com
3 2 test@example.com

View file

@ -0,0 +1,3 @@
id,email
1,"jbloggs@example.com"
1,test@example.com
1 id email
2 1 jbloggs@example.com
3 1 test@example.com

View file

@ -1,12 +1,11 @@
const should = require('should');
const path = require('path');
const fsLib = require('../../../../../../../../core/server/api/canary/utils/serializers/input/utils/members-import-csv');
const {readCSV} = require('../parse');
const csvPath = path.join(__dirname, '/fixtures/');
const csvPath = path.join(__dirname, '../../../../../../../utils/fixtures/csv/');
describe('members-import-csv: read csv', function () {
describe('read csv', function () {
it('read csv: one column', function (done) {
fsLib.readCSV({
readCSV({
path: csvPath + 'single-column-with-header.csv',
columnsToExtract: [{name: 'email', lookup: /email/i}]
}).then(function (result) {
@ -19,7 +18,7 @@ describe('members-import-csv: read csv', function () {
});
it('read csv: two columns, 1 filter', function (done) {
fsLib.readCSV({
readCSV({
path: csvPath + 'two-columns-with-header.csv',
columnsToExtract: [{name: 'email', lookup: /email/i}]
}).then(function (result) {
@ -34,7 +33,7 @@ describe('members-import-csv: read csv', function () {
});
it('read csv: two columns, 2 filters', function (done) {
fsLib.readCSV({
readCSV({
path: csvPath + 'two-columns-obscure-header.csv',
columnsToExtract: [
{name: 'email', lookup: /email/i},