adjusted test

This commit is contained in:
Xinrui Chen 2022-08-12 16:29:33 -07:00
parent 2092dec68d
commit b1aea42784
1 changed files with 4 additions and 4 deletions

View File

@ -13,23 +13,23 @@ describe('normalize', () => {
});
describe('parseSlug', () => {
const testStrings = ['test-product', 'TEST-pro-duct', 't-e-s-t-pr-od-u-c-t'];
const testStrings = ['test-product', 'TEST-pro-duct', 't-e-s-t-p-r-o-d-u-c-t'];
const key = ['test product', 'test pro duct', 't e s t p r o d u c t'];
test('it should remove dashes and replace with spaces', () => {
testStrings.forEach((str, i) => {
expect(normalize(str)).toEqual(key[i]);
expect(parseSlug(str)).toEqual(key[i]);
});
});
});
describe('parseName', () => {
const testStrings = ['test-product', 'TEST-pro-duct', 't-e-s-t-pr-od-u-c-t'];
const testStrings = ['test-product', 'test-pro-duct', 't-e-s-t-p-r-o-d-u-c-t'];
const key = ['test product', 'test pro duct', 't e s t p r o d u c t'];
test('it should replace spaces with dashes', () => {
key.forEach((str, i) => {
expect(normalize(str)).toEqual(testStrings[i]);
expect(parseName(str)).toEqual(testStrings[i]);
});
});
});