Skip to content

Commit

Permalink
✅♻️ simplify duplicate test
Browse files Browse the repository at this point in the history
  • Loading branch information
kylewelsby committed Mar 6, 2020
1 parent 91a6f64 commit 318db70
Show file tree
Hide file tree
Showing 2 changed files with 158 additions and 167 deletions.
33 changes: 12 additions & 21 deletions __tests__/Document.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,28 +137,19 @@ describe('Document', () => {
expect(subject.stylesDoc).toMatchSnapshot();
});

describe('master-page', () => {
let actual;
beforeEach(() => {
let key =
'office:document-styles.office:master-styles.style:master-page';
actual = get(subject.stylesDoc, key);
});

it('contains the expected master pages', () => {
expect(actual).toMatchSnapshot();
});
});

describe('office:automatic-styles.style:style', () => {
let actual;
beforeEach(() => {
let key = 'office:document-styles.office:automatic-styles.style:style';
actual = get(subject.stylesDoc, key);
});
[
'office:document-styles.office:master-styles.style:master-page',
'office:document-styles.office:automatic-styles.style:style'
].forEach(key => {
describe(key, () => {
let actual;
beforeEach(() => {
actual = get(subject.stylesDoc, key);
});

it('contains the automatic-styles from both files', () => {
expect(actual).toMatchSnapshot();
it(`contains the expected contents of ${key}`, () => {
expect(actual).toMatchSnapshot();
});
});
});
});
Expand Down
292 changes: 146 additions & 146 deletions __tests__/__snapshots__/Document.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2880,151 +2880,6 @@ Object {
}
`;

exports[`Document mergeStyles master-page contains the expected master pages 1`] = `
Array [
Object {
"draw:frame": Array [
Object {
"draw:image": Object {
"text:p": Object {},
"xlink:actuate": "onLoad",
"xlink:href": "Pictures/100000000000032000000258E080B12F.jpg",
"xlink:show": "embed",
"xlink:type": "simple",
},
"draw:layer": "backgroundobjects",
"draw:style-name": "Mgr1",
"draw:text-style-name": "MP1",
"svg:height": "21cm",
"svg:width": "28cm",
"svg:x": "-0.001cm",
"svg:y": "-0.001cm",
},
Object {
"draw:layer": "backgroundobjects",
"draw:text-box": Object {},
"presentation:class": "title",
"presentation:placeholder": "true",
"presentation:style-name": "prs-novelty-title",
"svg:height": "3.506cm",
"svg:width": "23.911cm",
"svg:x": "2.058cm",
"svg:y": "1.943cm",
},
Object {
"draw:layer": "backgroundobjects",
"draw:text-box": Object {},
"presentation:class": "outline",
"presentation:placeholder": "true",
"presentation:style-name": "prs-novelty-outline1",
"svg:height": "13.23cm",
"svg:width": "23.384cm",
"svg:x": "2.285cm",
"svg:y": "5.938cm",
},
],
"draw:style-name": "Mdp1",
"presentation:notes": Object {
"draw:frame": Object {
"draw:layer": "backgroundobjects",
"draw:text-box": Object {
"draw:corner-radius": "3107.312cm",
},
"presentation:class": "notes",
"presentation:placeholder": "true",
"presentation:style-name": "prs-novelty-notes",
"svg:height": "11.409cm",
"svg:width": "14.517cm",
"svg:x": "3.249cm",
"svg:y": "14.13cm",
},
"draw:page-thumbnail": Object {
"draw:layer": "backgroundobjects",
"presentation:class": "page",
"presentation:style-name": "prs-novelty-title",
"svg:height": "10.279cm",
"svg:width": "13.705cm",
"svg:x": "3.647cm",
"svg:y": "2.853cm",
},
"style:page-layout-name": "PM2",
},
"style:name": "prs-novelty",
"style:page-layout-name": "PM1",
},
Object {
"draw:frame": Array [
Object {
"draw:layer": "backgroundobjects",
"draw:text-box": Object {
"draw:corner-radius": "0.065cm",
},
"presentation:class": "title",
"presentation:placeholder": "true",
"presentation:style-name": "prs-strategy-title",
"svg:height": "3.506cm",
"svg:width": "23.911cm",
"svg:x": "2.058cm",
"svg:y": "0.325cm",
},
Object {
"draw:layer": "backgroundobjects",
"draw:text-box": Object {},
"presentation:class": "outline",
"presentation:placeholder": "true",
"presentation:style-name": "prs-strategy-outline1",
"svg:height": "13.23cm",
"svg:width": "23.548cm",
"svg:x": "3.023cm",
"svg:y": "6.178cm",
},
Object {
"draw:image": Object {
"text:p": Object {},
"xlink:actuate": "onLoad",
"xlink:href": "Pictures/2000023600002305000012CD3628FC8C.wmf",
"xlink:show": "embed",
"xlink:type": "simple",
},
"draw:layer": "backgroundobjects",
"draw:style-name": "Mgr1",
"draw:text-style-name": "MP1",
"svg:height": "2.937cm",
"svg:width": "5.47cm",
"svg:x": "22.048cm",
"svg:y": "17.365cm",
},
],
"draw:style-name": "Mdp1",
"presentation:notes": Object {
"draw:frame": Object {
"draw:layer": "backgroundobjects",
"draw:text-box": Object {},
"presentation:class": "notes",
"presentation:placeholder": "true",
"presentation:style-name": "prs-strategy-notes",
"svg:height": "11.409cm",
"svg:width": "14.517cm",
"svg:x": "3.249cm",
"svg:y": "14.13cm",
},
"draw:page-thumbnail": Object {
"draw:layer": "backgroundobjects",
"presentation:class": "page",
"presentation:style-name": "prs-strategy-title",
"svg:height": "10.279cm",
"svg:width": "13.705cm",
"svg:x": "3.647cm",
"svg:y": "2.853cm",
},
"style:page-layout-name": "PM2",
},
"style:name": "prs-strategy",
"style:page-layout-name": "PM1",
},
]
`;

exports[`Document mergeStyles merges style content from the presentation into the document style 1`] = `
Object {
"office:document-styles": Object {
Expand Down Expand Up @@ -12984,7 +12839,7 @@ Object {
}
`;

exports[`Document mergeStyles office:automatic-styles.style:style contains the automatic-styles from both files 1`] = `
exports[`Document mergeStyles office:document-styles.office:automatic-styles.style:style contains the expected contents of office:document-styles.office:automatic-styles.style:style 1`] = `
Array [
Object {
"style:drawing-page-properties": Object {
Expand Down Expand Up @@ -13088,3 +12943,148 @@ Array [
},
]
`;

exports[`Document mergeStyles office:document-styles.office:master-styles.style:master-page contains the expected contents of office:document-styles.office:master-styles.style:master-page 1`] = `
Array [
Object {
"draw:frame": Array [
Object {
"draw:image": Object {
"text:p": Object {},
"xlink:actuate": "onLoad",
"xlink:href": "Pictures/100000000000032000000258E080B12F.jpg",
"xlink:show": "embed",
"xlink:type": "simple",
},
"draw:layer": "backgroundobjects",
"draw:style-name": "Mgr1",
"draw:text-style-name": "MP1",
"svg:height": "21cm",
"svg:width": "28cm",
"svg:x": "-0.001cm",
"svg:y": "-0.001cm",
},
Object {
"draw:layer": "backgroundobjects",
"draw:text-box": Object {},
"presentation:class": "title",
"presentation:placeholder": "true",
"presentation:style-name": "prs-novelty-title",
"svg:height": "3.506cm",
"svg:width": "23.911cm",
"svg:x": "2.058cm",
"svg:y": "1.943cm",
},
Object {
"draw:layer": "backgroundobjects",
"draw:text-box": Object {},
"presentation:class": "outline",
"presentation:placeholder": "true",
"presentation:style-name": "prs-novelty-outline1",
"svg:height": "13.23cm",
"svg:width": "23.384cm",
"svg:x": "2.285cm",
"svg:y": "5.938cm",
},
],
"draw:style-name": "Mdp1",
"presentation:notes": Object {
"draw:frame": Object {
"draw:layer": "backgroundobjects",
"draw:text-box": Object {
"draw:corner-radius": "3107.312cm",
},
"presentation:class": "notes",
"presentation:placeholder": "true",
"presentation:style-name": "prs-novelty-notes",
"svg:height": "11.409cm",
"svg:width": "14.517cm",
"svg:x": "3.249cm",
"svg:y": "14.13cm",
},
"draw:page-thumbnail": Object {
"draw:layer": "backgroundobjects",
"presentation:class": "page",
"presentation:style-name": "prs-novelty-title",
"svg:height": "10.279cm",
"svg:width": "13.705cm",
"svg:x": "3.647cm",
"svg:y": "2.853cm",
},
"style:page-layout-name": "PM2",
},
"style:name": "prs-novelty",
"style:page-layout-name": "PM1",
},
Object {
"draw:frame": Array [
Object {
"draw:layer": "backgroundobjects",
"draw:text-box": Object {
"draw:corner-radius": "0.065cm",
},
"presentation:class": "title",
"presentation:placeholder": "true",
"presentation:style-name": "prs-strategy-title",
"svg:height": "3.506cm",
"svg:width": "23.911cm",
"svg:x": "2.058cm",
"svg:y": "0.325cm",
},
Object {
"draw:layer": "backgroundobjects",
"draw:text-box": Object {},
"presentation:class": "outline",
"presentation:placeholder": "true",
"presentation:style-name": "prs-strategy-outline1",
"svg:height": "13.23cm",
"svg:width": "23.548cm",
"svg:x": "3.023cm",
"svg:y": "6.178cm",
},
Object {
"draw:image": Object {
"text:p": Object {},
"xlink:actuate": "onLoad",
"xlink:href": "Pictures/2000023600002305000012CD3628FC8C.wmf",
"xlink:show": "embed",
"xlink:type": "simple",
},
"draw:layer": "backgroundobjects",
"draw:style-name": "Mgr1",
"draw:text-style-name": "MP1",
"svg:height": "2.937cm",
"svg:width": "5.47cm",
"svg:x": "22.048cm",
"svg:y": "17.365cm",
},
],
"draw:style-name": "Mdp1",
"presentation:notes": Object {
"draw:frame": Object {
"draw:layer": "backgroundobjects",
"draw:text-box": Object {},
"presentation:class": "notes",
"presentation:placeholder": "true",
"presentation:style-name": "prs-strategy-notes",
"svg:height": "11.409cm",
"svg:width": "14.517cm",
"svg:x": "3.249cm",
"svg:y": "14.13cm",
},
"draw:page-thumbnail": Object {
"draw:layer": "backgroundobjects",
"presentation:class": "page",
"presentation:style-name": "prs-strategy-title",
"svg:height": "10.279cm",
"svg:width": "13.705cm",
"svg:x": "3.647cm",
"svg:y": "2.853cm",
},
"style:page-layout-name": "PM2",
},
"style:name": "prs-strategy",
"style:page-layout-name": "PM1",
},
]
`;

0 comments on commit 318db70

Please sign in to comment.